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
0a5dd05b
Commit
0a5dd05b
authored
Nov 08, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add target contract name to the compiler
parent
ca0bcc5a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
app.js
src/app.js
+4
-2
compiler.js
src/app/compiler.js
+9
-9
No files found.
src/app.js
View file @
0a5dd05b
...
@@ -520,9 +520,11 @@ var run = function () {
...
@@ -520,9 +520,11 @@ var run = function () {
}
}
compileTimeout
=
window
.
setTimeout
(
function
()
{
compileTimeout
=
window
.
setTimeout
(
function
()
{
var
files
=
{}
var
files
=
{}
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
editor
.
getValue
(
)
var
target
=
utils
.
fileNameFromKey
(
editor
.
getCacheFile
()
)
compiler
.
compile
(
files
)
files
[
target
]
=
editor
.
getValue
()
compiler
.
compile
(
files
,
target
)
},
300
)
},
300
)
}
}
...
...
src/app/compiler.js
View file @
0a5dd05b
...
@@ -28,8 +28,8 @@ function Compiler (editor, handleImportCall) {
...
@@ -28,8 +28,8 @@ function Compiler (editor, handleImportCall) {
optimize
=
_optimize
optimize
=
_optimize
}
}
var
internalCompile
=
function
(
files
,
missingInputs
)
{
var
internalCompile
=
function
(
files
,
target
,
missingInputs
)
{
gatherImports
(
files
,
missingInputs
,
function
(
error
,
input
)
{
gatherImports
(
files
,
target
,
missingInputs
,
function
(
error
,
input
)
{
if
(
error
)
{
if
(
error
)
{
self
.
lastCompilationResult
=
null
self
.
lastCompilationResult
=
null
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
{
'error'
:
error
},
files
])
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
{
'error'
:
error
},
files
])
...
@@ -39,9 +39,9 @@ function Compiler (editor, handleImportCall) {
...
@@ -39,9 +39,9 @@ function Compiler (editor, handleImportCall) {
})
})
}
}
var
compile
=
function
(
files
)
{
var
compile
=
function
(
files
,
target
)
{
self
.
event
.
trigger
(
'compilationStarted'
,
[])
self
.
event
.
trigger
(
'compilationStarted'
,
[])
internalCompile
(
files
)
internalCompile
(
files
,
target
)
}
}
this
.
compile
=
compile
this
.
compile
=
compile
...
@@ -120,7 +120,7 @@ function Compiler (editor, handleImportCall) {
...
@@ -120,7 +120,7 @@ function Compiler (editor, handleImportCall) {
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
data
,
source
])
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
data
,
source
])
}
else
if
(
missingInputs
!==
undefined
&&
missingInputs
.
length
>
0
)
{
}
else
if
(
missingInputs
!==
undefined
&&
missingInputs
.
length
>
0
)
{
// try compiling again with the new set of inputs
// try compiling again with the new set of inputs
internalCompile
(
source
.
sources
,
missingInputs
)
internalCompile
(
source
.
sources
,
source
.
target
,
missingInputs
)
}
else
{
}
else
{
data
=
updateInterface
(
data
)
data
=
updateInterface
(
data
)
...
@@ -208,10 +208,10 @@ function Compiler (editor, handleImportCall) {
...
@@ -208,10 +208,10 @@ function Compiler (editor, handleImportCall) {
worker
.
postMessage
({
cmd
:
'loadVersion'
,
data
:
url
})
worker
.
postMessage
({
cmd
:
'loadVersion'
,
data
:
url
})
}
}
function
gatherImports
(
files
,
importHints
,
cb
)
{
function
gatherImports
(
files
,
target
,
importHints
,
cb
)
{
importHints
=
importHints
||
[]
importHints
=
importHints
||
[]
if
(
!
compilerAcceptsMultipleFiles
)
{
if
(
!
compilerAcceptsMultipleFiles
)
{
cb
(
null
,
files
[
editor
.
getCacheFile
()
])
cb
(
null
,
files
[
target
])
return
return
}
}
...
@@ -246,14 +246,14 @@ function Compiler (editor, handleImportCall) {
...
@@ -246,14 +246,14 @@ function Compiler (editor, handleImportCall) {
cb
(
err
)
cb
(
err
)
}
else
{
}
else
{
files
[
m
]
=
content
files
[
m
]
=
content
gatherImports
(
files
,
importHints
,
cb
)
gatherImports
(
files
,
target
,
importHints
,
cb
)
}
}
})
})
return
return
}
}
cb
(
null
,
{
'sources'
:
files
})
cb
(
null
,
{
'sources'
:
files
,
'target'
:
target
})
}
}
function
truncateVersion
(
version
)
{
function
truncateVersion
(
version
)
{
...
...
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