let instead of const to return await

pull/543/head
LianaHus 4 years ago
parent e48b1b889e
commit ef0c878bcc
  1. 2
      apps/remix-ide/src/app/compiler/compiler-helpers.js
  2. 2
      apps/remix-ide/src/app/tabs/compile-tab.js
  3. 12
      apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js

@ -4,7 +4,7 @@ import { Compiler } from '@remix-project/remix-solidity'
import CompilerAbstract from './compiler-abstract'
export const compile = async (compilationTargets, settings) => {
const res = await (() => {
let res = await (() => {
return new Promise((resolve, reject) => {
const compiler = new Compiler(() => {})
compiler.set('evmVersion', settings.evmVersion)

@ -221,7 +221,7 @@ class CompileTab extends ViewPlugin {
* @param {object} settings {evmVersion, optimize, runs, version, language}
*/
async compileWithParameters (compilationTargets, settings) {
const res = await compile(compilationTargets, settings)
let res = await compile(compilationTargets, settings)
return res
}

@ -200,6 +200,7 @@ class CompilerContainer {
placeholder="200"
type="number"
title="Number of optimisation runs."
onchange=${() => this.onchangeRuns()}
>`
if (this.compileTabLogic.optimize) this._view.runs.removeAttribute('disabled')
else {
@ -343,13 +344,19 @@ class CompilerContainer {
onchangeOptimize () {
this.compileTabLogic.setOptimize(!!this._view.optimize.checked)
if (this.compileTabLogic.optimize) this._view.runs.removeAttribute('disabled')
else {
if (this.compileTabLogic.optimize) {
this._view.runs.removeAttribute('disabled')
} else {
this._view.runs.setAttribute('disabled', '')
}
this.compileIfAutoCompileOn()
}
onchangeRuns () {
this.compileTabLogic.setRuns(this._view.runs.value)
this.compileIfAutoCompileOn()
}
onchangeLanguage () {
this.compileTabLogic.setLanguage(this._view.languageSelector.value)
this.compileIfAutoCompileOn()
@ -391,6 +398,7 @@ class CompilerContainer {
setRuns (value) {
this._view.runs.value = value
this.onchangeRuns()
}
setLanguage (lang) {

Loading…
Cancel
Save