Commit 364c4dbd authored by Alex Beregszaszi's avatar Alex Beregszaszi

Worker: use canonical reference to postMessage/importScripts

parent d0db134a
...@@ -11,7 +11,7 @@ module.exports = function (self) { ...@@ -11,7 +11,7 @@ module.exports = function (self) {
version = null; version = null;
compileJSON = null; compileJSON = null;
importScripts(data.data); self.importScripts(data.data);
var Module = window.Module; var Module = window.Module;
version = Module.cwrap('version', 'string', []); version = Module.cwrap('version', 'string', []);
...@@ -28,7 +28,7 @@ module.exports = function (self) { ...@@ -28,7 +28,7 @@ module.exports = function (self) {
} else { } else {
compileJSON = Module.cwrap('compileJSON', 'string', ['string', 'number']); compileJSON = Module.cwrap('compileJSON', 'string', ['string', 'number']);
} }
postMessage({ self.postMessage({
cmd: 'versionLoaded', cmd: 'versionLoaded',
data: version(), data: version(),
acceptsMultipleFiles: ('_compileJSONMulti' in Module) acceptsMultipleFiles: ('_compileJSONMulti' in Module)
...@@ -36,7 +36,7 @@ module.exports = function (self) { ...@@ -36,7 +36,7 @@ module.exports = function (self) {
break; break;
case 'compile': case 'compile':
missingInputs.length = 0; missingInputs.length = 0;
postMessage({cmd: 'compiled', data: compileJSON(data.source, data.optimize), missingInputs: missingInputs}); self.postMessage({cmd: 'compiled', data: compileJSON(data.source, data.optimize), missingInputs: missingInputs});
break; break;
} }
}, false); }, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment