From 364c4dbdbc55ed49e8903645950965158210b64b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 8 Jun 2016 21:05:13 +0100 Subject: [PATCH] Worker: use canonical reference to postMessage/importScripts --- src/app/compiler-worker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/compiler-worker.js b/src/app/compiler-worker.js index fddc6464aa..c511899e60 100644 --- a/src/app/compiler-worker.js +++ b/src/app/compiler-worker.js @@ -11,7 +11,7 @@ module.exports = function (self) { version = null; compileJSON = null; - importScripts(data.data); + self.importScripts(data.data); var Module = window.Module; version = Module.cwrap('version', 'string', []); @@ -28,7 +28,7 @@ module.exports = function (self) { } else { compileJSON = Module.cwrap('compileJSON', 'string', ['string', 'number']); } - postMessage({ + self.postMessage({ cmd: 'versionLoaded', data: version(), acceptsMultipleFiles: ('_compileJSONMulti' in Module) @@ -36,7 +36,7 @@ module.exports = function (self) { break; case 'compile': 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; } }, false);