Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
5dbcffad
Unverified
Commit
5dbcffad
authored
Jul 13, 2020
by
Aniket
Committed by
GitHub
Jul 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update compiler-worker.ts
parent
bb6d16b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
compiler-worker.ts
libs/remix-solidity/src/compiler/compiler-worker.ts
+26
-24
No files found.
libs/remix-solidity/src/compiler/compiler-worker.ts
View file @
5dbcffad
'use strict'
'use strict'
import
solc
from
'solc/wrapper'
import
*
as
solc
from
'solc/wrapper'
import
{
CompilerInput
,
MessageToWorker
}
from
'./types'
import
{
CompilerInput
,
MessageToWorker
}
from
'./types'
var
compileJSON
:
((
input
:
CompilerInput
)
=>
string
)
|
null
=
(
input
)
=>
{
return
''
}
let
compileJSON
:
((
input
:
CompilerInput
)
=>
string
)
|
null
=
(
input
)
=>
{
return
''
}
var
missingInputs
:
string
[]
=
[]
const
missingInputs
:
string
[]
=
[]
// 'DedicatedWorkerGlobalScope' object (the Worker global scope) is accessible through the self keyword
// '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
// 'dom' and 'webworker' library files can't be included together https://github.com/microsoft/TypeScript/issues/20595
export
default
(
self
)
=>
{
export
default
function
(
self
)
{
// eslint-disable-line @typescript-eslint/explicit-module-boundary-types
self
.
addEventListener
(
'message'
,
(
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'
:
delete
self
.
Module
{
// NOTE: workaround some browsers?
delete
self
.
Module
self
.
Module
=
undefined
// NOTE: workaround some browsers?
compileJSON
=
null
self
.
Module
=
undefined
//importScripts() method of synchronously imports one or more scripts into the worker's scope
compileJSON
=
null
self
.
importScripts
(
data
.
data
)
//importScripts() method of synchronously imports one or more scripts into the worker's scope
let
compiler
:
solc
=
solc
(
self
.
Module
)
self
.
importScripts
(
data
.
data
)
compileJSON
=
(
input
)
=>
{
const
compiler
:
solc
=
solc
(
self
.
Module
)
try
{
compileJSON
=
(
input
)
=>
{
let
missingInputsCallback
=
(
path
)
=>
{
try
{
missingInputs
.
push
(
path
)
const
missingInputsCallback
=
(
path
)
=>
{
return
{
'error'
:
'Deferred import'
}
missingInputs
.
push
(
path
)
return
{
'error'
:
'Deferred import'
}
}
return
compiler
.
compile
(
input
,
{
import
:
missingInputsCallback
})
}
catch
(
exception
)
{
return
JSON
.
stringify
({
error
:
'Uncaught JavaScript exception:
\
n'
+
exception
})
}
}
return
compiler
.
compile
(
input
,
{
import
:
missingInputsCallback
})
}
catch
(
exception
)
{
return
JSON
.
stringify
({
error
:
'Uncaught JavaScript exception:
\
n'
+
exception
})
}
}
self
.
postMessage
({
cmd
:
'versionLoaded'
,
data
:
compiler
.
version
()
})
break
}
}
self
.
postMessage
({
cmd
:
'versionLoaded'
,
data
:
compiler
.
version
()
})
break
case
'compile'
:
case
'compile'
:
missingInputs
.
length
=
0
missingInputs
.
length
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment