From b4f1857e08571502fdf4c2bd0282788a3fc72171 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 6 Sep 2016 20:41:06 +0100 Subject: [PATCH] Workaround some browsers and delete loaded compiler properly --- src/app/compiler-worker.js | 3 +++ src/app/compiler.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/app/compiler-worker.js b/src/app/compiler-worker.js index 14c81f0905..f6d01d668e 100644 --- a/src/app/compiler-worker.js +++ b/src/app/compiler-worker.js @@ -9,6 +9,9 @@ module.exports = function (self) { switch (data.cmd) { case 'loadVersion': delete self.Module; + // NOTE: workaround some browsers? + self.Module = undefined; + compileJSON = null; self.importScripts(data.data); diff --git a/src/app/compiler.js b/src/app/compiler.js index 7ae4461bee..e182717835 100644 --- a/src/app/compiler.js +++ b/src/app/compiler.js @@ -144,6 +144,9 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) { function loadInternal (url) { delete window.Module; + // NOTE: workaround some browsers? + window.Module = undefined; + // Set a safe fallback until the new one is loaded setCompileJSON(function (source, optimize) { compilationFinished({error: 'Compiler not yet loaded.'});