Commit 66fa2946 authored by chriseth's avatar chriseth Committed by GitHub

Merge pull request #200 from ethereum/clean-compiler-url

Move the solc lookup URL to the proper location
parents 55767323 4793fca8
...@@ -352,7 +352,6 @@ var run = function () { ...@@ -352,7 +352,6 @@ var run = function () {
$('#versionSelector').append(new Option('latest local version', 'soljson.js')); $('#versionSelector').append(new Option('latest local version', 'soljson.js'));
$('#versionSelector').change(function () { $('#versionSelector').change(function () {
queryParams.update({ version: $('#versionSelector').val() });
loadVersion($('#versionSelector').val()); loadVersion($('#versionSelector').val());
}); });
...@@ -487,14 +486,20 @@ var run = function () { ...@@ -487,14 +486,20 @@ var run = function () {
if (window.soljsonReleases !== undefined && window.soljsonReleases[version] !== undefined) { if (window.soljsonReleases !== undefined && window.soljsonReleases[version] !== undefined) {
version = window.soljsonReleases[version]; 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'; var isFirefox = typeof InstallTrigger !== 'undefined';
if (document.location.protocol !== 'file:' && Worker !== undefined && isFirefox) { if (document.location.protocol !== 'file:' && Worker !== undefined && isFirefox) {
// Workers cannot load js on "file:"-URLs and we get a // Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
// resort to non-worker version in that case. // resort to non-worker version in that case.
compiler.loadVersion(true, version); compiler.loadVersion(true, url);
} else { } else {
compiler.loadVersion(false, version); compiler.loadVersion(false, url);
} }
}; };
......
...@@ -123,13 +123,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) { ...@@ -123,13 +123,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
} }
} }
this.loadVersion = function (usingWorker, version) { this.loadVersion = function (usingWorker, url) {
var url;
if (version !== 'soljson.js') {
url = 'https://ethereum.github.io/solc-bin/bin/' + version;
} else {
url = 'soljson.js';
}
console.log('Loading ' + url + ' ' + (usingWorker ? 'with worker' : 'without worker')); console.log('Loading ' + url + ' ' + (usingWorker ? 'with worker' : 'without worker'));
if (usingWorker) { if (usingWorker) {
......
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