Commit db0a8172 authored by aniket-engg's avatar aniket-engg Committed by Aniket

arrow functions

parent 5a0f6714
...@@ -5,8 +5,10 @@ import { CompilerInput, MessageToWorker } from './types' ...@@ -5,8 +5,10 @@ import { CompilerInput, MessageToWorker } from './types'
var compileJSON: ((input: CompilerInput) => string) | null = (input) => { return '' } var compileJSON: ((input: CompilerInput) => string) | null = (input) => { return '' }
var missingInputs: string[] = [] 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) => { export default (self) => {
self.addEventListener('message', function (e) { self.addEventListener('message', (e) => {
const data: MessageToWorker = e.data const data: MessageToWorker = e.data
switch (data.cmd) { switch (data.cmd) {
case 'loadVersion': case 'loadVersion':
...@@ -19,7 +21,7 @@ export default (self) => { ...@@ -19,7 +21,7 @@ export default (self) => {
let compiler: solc = solc(self.Module) let compiler: solc = solc(self.Module)
compileJSON = (input) => { compileJSON = (input) => {
try { try {
let missingInputsCallback = function (path) { let missingInputsCallback = (path) => {
missingInputs.push(path) missingInputs.push(path)
return { 'error': 'Deferred import' } return { 'error': 'Deferred import' }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment