From a4b1b968949121e75283f82eb577b27672b43a08 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Mar 2023 11:13:40 +0100 Subject: [PATCH] remove unused --- .../src/compiler/compiler-worker.ts | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 libs/remix-solidity/src/compiler/compiler-worker.ts diff --git a/libs/remix-solidity/src/compiler/compiler-worker.ts b/libs/remix-solidity/src/compiler/compiler-worker.ts deleted file mode 100644 index 6d00d87019..0000000000 --- a/libs/remix-solidity/src/compiler/compiler-worker.ts +++ /dev/null @@ -1,73 +0,0 @@ -'use strict' - -import * as solc from 'solc/wrapper' -import { CompilerInput, MessageToWorker } from './types' -let compileJSON: ((input: CompilerInput) => string) | null = (input) => { return '' } -const missingInputs: string[] = [] - -// 'DedicatedWorkerGlobalScope' object (the Worker global scope) is accessible through the self keyword -// 'dom' and 'webworker' library files can't be included together https://github.com/microsoft/TypeScript/issues/20595 -export default function (self) { // eslint-disable-line @typescript-eslint/explicit-module-boundary-types - self.addEventListener('message', (e) => { - const data: MessageToWorker = e.data - switch (data.cmd) { - case 'loadVersion': - { - delete self.Module - // NOTE: workaround some browsers? - self.Module = undefined - compileJSON = null - // importScripts() method of synchronously imports one or more scripts into the worker's scope - self.importScripts(data.data) - const compiler: solc = solc(self.Module) - compileJSON = (input) => { - try { - const missingInputsCallback = (path) => { - missingInputs.push(path) - return { error: 'Deferred import' } - } - return compiler.compile(input, { import: missingInputsCallback }) - } catch (exception) { - return JSON.stringify({ error: 'Uncaught JavaScript exception:\n' + exception }) - } - } - self.postMessage({ - cmd: 'versionLoaded', - data: compiler.version(), - license: compiler.license() - }) - break - } - - case 'compile': { - missingInputs.length = 0 - if (data.input && compileJSON) { - self.postMessage({ - cmd: 'compiled', - job: data.job, - timestamp: data.timestamp, - data: compileJSON(data.input), - input: data.input, - missingInputs: missingInputs - }) - } - break - } - - case 'standalone-compile': - missingInputs.length = 0 - if (data.input && compileJSON) { - self.postMessage({ - cmd: 'standalone-compiled', - job: data.job, - timestamp: data.timestamp, - data: compileJSON(data.input), - input: data.input, - missingInputs: missingInputs - }) - } - break - } - - }, false) -}