From 3a0e0430abf2de79c77b49c7de22ee6371330ee3 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 3 Jan 2020 17:51:16 +0530 Subject: [PATCH] arrow functions --- remix-solidity/src/compiler/compiler-worker.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/remix-solidity/src/compiler/compiler-worker.ts b/remix-solidity/src/compiler/compiler-worker.ts index faaab68e0e..7663343fb6 100644 --- a/remix-solidity/src/compiler/compiler-worker.ts +++ b/remix-solidity/src/compiler/compiler-worker.ts @@ -5,8 +5,10 @@ import { CompilerInput, MessageToWorker } from './types' var compileJSON: ((input: CompilerInput) => string) | null = (input) => { return '' } var missingInputs: string[] = [] +// 'DedicatedWorkerGlobalScope' object (the Worker global scope) is accessible through the self keyword +// 'dom' and 'webworker' library files can not be included together export default (self) => { - self.addEventListener('message', function (e) { + self.addEventListener('message', (e) => { const data: MessageToWorker = e.data switch (data.cmd) { case 'loadVersion': @@ -19,7 +21,7 @@ export default (self) => { let compiler: solc = solc(self.Module) compileJSON = (input) => { try { - let missingInputsCallback = function (path) { + let missingInputsCallback = (path) => { missingInputs.push(path) return { 'error': 'Deferred import' } }