Skip to content

Commit 87b88a9

Browse files
committed
do not preserve compiler state on worker error on load
1 parent db93a9c commit 87b88a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libs/remix-tests/src/compiler.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp
196196
compiler.loadVersion(usingWorker, currentCompilerUrl)
197197
// @ts-ignore
198198
compiler.event.register('compilerLoaded', this, (version) => {
199-
console.log('Inside compiler loaded')
200199
next()
201200
})
202201
} else {
@@ -205,9 +204,9 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp
205204
}
206205
},
207206
(next) => {
208-
console.log('compiler before compilation', compiler)
209207
const compilationFinishedCb = (success, data, source) => {
210-
UTRunner.compiler = compiler
208+
// data.error usually exists for exceptions like worker error etc.
209+
if (!data.error) UTRunner.compiler = compiler
211210
if (opts && opts.event) opts.event.emit('compilationFinished', success, data, source)
212211
next(null, data)
213212
}

0 commit comments

Comments
 (0)