From 9482ac9251ee20e91b2ef35debbe3ca8f95627c3 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 1 Sep 2016 00:07:38 +0100 Subject: [PATCH] Move the URL magic for loadVersion from the compiler to the app --- src/app.js | 10 ++++++++-- src/app/compiler.js | 8 +------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app.js b/src/app.js index 79847f8492..079f51022f 100644 --- a/src/app.js +++ b/src/app.js @@ -487,14 +487,20 @@ var run = function () { if (window.soljsonReleases !== undefined && window.soljsonReleases[version] !== undefined) { version = window.soljsonReleases[version]; } + var url; + if (version !== 'soljson.js') { + url = 'https://ethereum.github.io/solc-bin/bin/' + version; + } else { + url = 'soljson.js'; + } var isFirefox = typeof InstallTrigger !== 'undefined'; if (document.location.protocol !== 'file:' && Worker !== undefined && isFirefox) { // Workers cannot load js on "file:"-URLs and we get a // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // resort to non-worker version in that case. - compiler.loadVersion(true, version); + compiler.loadVersion(true, url); } else { - compiler.loadVersion(false, version); + compiler.loadVersion(false, url); } }; diff --git a/src/app/compiler.js b/src/app/compiler.js index de0e24a57d..f3c6e9270b 100644 --- a/src/app/compiler.js +++ b/src/app/compiler.js @@ -123,13 +123,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) { } } - this.loadVersion = function (usingWorker, version) { - var url; - if (version !== 'soljson.js') { - url = 'https://ethereum.github.io/solc-bin/bin/' + version; - } else { - url = 'soljson.js'; - } + this.loadVersion = function (usingWorker, url) { console.log('Loading ' + url + ' ' + (usingWorker ? 'with worker' : 'without worker')); if (usingWorker) {