do not preserve compiler state on worker error on load

pull/1954/head
aniket-engg 3 years ago committed by Aniket
parent db93a9ce76
commit 87b88a9676
  1. 5
      libs/remix-tests/src/compiler.ts

@ -196,7 +196,6 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp
compiler.loadVersion(usingWorker, currentCompilerUrl) compiler.loadVersion(usingWorker, currentCompilerUrl)
// @ts-ignore // @ts-ignore
compiler.event.register('compilerLoaded', this, (version) => { compiler.event.register('compilerLoaded', this, (version) => {
console.log('Inside compiler loaded')
next() next()
}) })
} else { } else {
@ -205,9 +204,9 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp
} }
}, },
(next) => { (next) => {
console.log('compiler before compilation', compiler)
const compilationFinishedCb = (success, data, source) => { const compilationFinishedCb = (success, data, source) => {
UTRunner.compiler = compiler // data.error usually exists for exceptions like worker error etc.
if (!data.error) UTRunner.compiler = compiler
if (opts && opts.event) opts.event.emit('compilationFinished', success, data, source) if (opts && opts.event) opts.event.emit('compilationFinished', success, data, source)
next(null, data) next(null, data)
} }

Loading…
Cancel
Save