From 87b88a9676807739a18692c87906105b1490a18a Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 12 Jan 2022 19:30:21 +0530 Subject: [PATCH] do not preserve compiler state on worker error on load --- libs/remix-tests/src/compiler.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/remix-tests/src/compiler.ts b/libs/remix-tests/src/compiler.ts index 05852c5b3d..740a306931 100644 --- a/libs/remix-tests/src/compiler.ts +++ b/libs/remix-tests/src/compiler.ts @@ -196,7 +196,6 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp compiler.loadVersion(usingWorker, currentCompilerUrl) // @ts-ignore compiler.event.register('compilerLoaded', this, (version) => { - console.log('Inside compiler loaded') next() }) } else { @@ -205,9 +204,9 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp } }, (next) => { - console.log('compiler before compilation', compiler) 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) next(null, data) }