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
4d5ea4f4
Commit
4d5ea4f4
authored
Oct 17, 2017
by
chriseth
Committed by
yann300
Nov 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use compilerInput before sending to worker.
parent
9f160f01
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
14 deletions
+6
-14
compiler-input.js
src/app/compiler/compiler-input.js
+2
-7
compiler-worker.js
src/app/compiler/compiler-worker.js
+3
-6
compiler.js
src/app/compiler/compiler.js
+1
-1
No files found.
src/app/compiler/compiler-input.js
View file @
4d5ea4f4
'use strict'
/*
opts:
- optimize
- { file_name: { library_name: address } }
*/
module
.
exports
=
(
sources
,
opts
)
=>
{
var
target
=
opts
.
target
?
opts
.
target
:
'*'
return
JSON
.
stringify
({
target
:
opts
.
target
,
language
:
'Solidity'
,
sources
:
sources
,
settings
:
{
...
...
@@ -18,7 +13,7 @@ module.exports = (sources, opts) => {
},
libraries
:
opts
.
libraries
,
outputSelection
:
{
'*'
:
{
[
target
]
:
{
'*'
:
[
'metadata'
,
'evm.bytecode'
,
'evm.deployedBytecode'
,
'abi'
,
'legacyAST'
,
'metadata'
,
'evm.assembly'
,
'evm.methodIdentifiers'
,
'evm.gasEstimates'
]
}
}
...
...
src/app/compiler/compiler-worker.js
View file @
4d5ea4f4
'use strict'
var
solc
=
require
(
'solc/wrapper'
)
var
compilerInput
=
require
(
'./compiler-input'
)
var
compileJSON
=
function
()
{
return
''
}
var
missingInputs
=
[]
...
...
@@ -21,11 +20,9 @@ module.exports = function (self) {
var
compiler
=
solc
(
self
.
Module
)
compileJSON
=
function
(
input
,
optimize
)
{
compileJSON
=
function
(
input
)
{
try
{
input
=
JSON
.
parse
(
input
)
var
inputStandard
=
compilerInput
(
input
.
sources
,
{
optimize
:
optimize
,
target
:
input
.
target
})
return
compiler
.
compileStandardWrapper
(
inputStandard
,
function
(
path
)
{
return
compiler
.
compileStandardWrapper
(
input
,
function
(
path
)
{
missingInputs
.
push
(
path
)
return
{
'error'
:
'Deferred import'
}
})
...
...
@@ -42,7 +39,7 @@ module.exports = function (self) {
break
case
'compile'
:
missingInputs
.
length
=
0
self
.
postMessage
({
cmd
:
'compiled'
,
job
:
data
.
job
,
data
:
compileJSON
(
data
.
source
,
data
.
optimize
),
missingInputs
:
missingInputs
})
self
.
postMessage
({
cmd
:
'compiled'
,
job
:
data
.
job
,
data
:
compileJSON
(
data
.
input
),
missingInputs
:
missingInputs
})
break
}
},
false
)
...
...
src/app/compiler/compiler.js
View file @
4d5ea4f4
...
...
@@ -288,7 +288,7 @@ function Compiler (handleImportCall) {
})
compileJSON
=
function
(
source
,
optimize
)
{
jobs
.
push
({
sources
:
source
})
worker
.
postMessage
({
cmd
:
'compile'
,
job
:
jobs
.
length
-
1
,
source
:
JSON
.
stringify
(
source
),
optimize
:
optimize
})
worker
.
postMessage
({
cmd
:
'compile'
,
job
:
jobs
.
length
-
1
,
input
:
compilerInput
(
source
.
sources
,
{
optimize
:
optimize
,
target
:
source
.
target
})
})
}
worker
.
postMessage
({
cmd
:
'loadVersion'
,
data
:
url
})
}
...
...
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