Commit 99f237db authored by yann300's avatar yann300

remove loadCompiler use compiler directly

parent 3f8b8716
......@@ -767,17 +767,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
compiler.setOptimize(optimize)
if (runCompilation) runCompiler()
},
loadCompiler: (usingWorker, url) => {
compiler.loadVersion(usingWorker, url)
},
runCompiler: () => {
runCompiler()
},
logMessage: (msg) => {
self._components.editorpanel.log({type: 'log', value: msg})
},
getCompilationResult: () => {
return compiler.lastCompilationResult
}
}
var rhpEvents = {
......@@ -789,7 +783,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}
var rhpOpts = {
pluginAPI: new PluginAPI(self, compiler),
udapp: udapp
udapp: udapp,
compiler: compiler
}
self._components.righthandpanel = new RighthandPanel(rhpAPI, rhpEvents, rhpOpts)
......
......@@ -178,7 +178,7 @@ function SettingsTab (appAPI = {}, appEvents = {}, opts = {}) {
// load the new version upon change
versionSelector.addEventListener('change', function () {
loadVersion(versionSelector.value, queryParams, appAPI, el)
loadVersion(versionSelector.value, queryParams, opts.compiler, el)
})
var header = new Option('Select new compiler version')
......@@ -195,7 +195,7 @@ function SettingsTab (appAPI = {}, appEvents = {}, opts = {}) {
// loading failed for some reason, fall back to local compiler
versionSelector.append(new Option('latest local version', 'builtin'))
loadVersion('builtin', queryParams, appAPI, el)
loadVersion('builtin', queryParams, opts.compiler, el)
return
}
......@@ -217,7 +217,7 @@ function SettingsTab (appAPI = {}, appEvents = {}, opts = {}) {
selectedVersion = queryParams.get().version
}
loadVersion(selectedVersion, queryParams, appAPI, el)
loadVersion(selectedVersion, queryParams, opts.compiler, el)
})
return { render () { return el } }
......@@ -227,7 +227,7 @@ function setVersionText (text, el) {
el.querySelector('#version').innerText = text
}
function loadVersion (version, queryParams, appAPI, el) {
function loadVersion (version, queryParams, compiler, el) {
queryParams.update({ version: version })
var url
if (version === 'builtin') {
......@@ -253,10 +253,10 @@ function loadVersion (version, queryParams, appAPI, el) {
// 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.
appAPI.loadCompiler(true, url)
compiler.loadVersion(true, url)
setVersionText('(loading using worker)', el)
} else {
appAPI.loadCompiler(false, url)
compiler.loadVersion(false, url)
setVersionText('(loading)', el)
}
}
......
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