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
3e2076d0
Commit
3e2076d0
authored
Sep 10, 2016
by
Alex Beregszaszi
Committed by
GitHub
Sep 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #232 from ethereum/fix-gather-imports
Fix gather imports
parents
b0b6217d
661294e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
compiler.js
src/app/compiler.js
+18
-3
No files found.
src/app/compiler.js
View file @
3e2076d0
...
@@ -30,7 +30,8 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -30,7 +30,8 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
;
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
;
gatherImports
(
files
,
missingInputs
,
function
(
input
,
error
)
{
gatherImports
(
files
,
missingInputs
,
function
(
input
,
error
)
{
if
(
input
===
null
)
{
if
(
input
===
null
)
{
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
[
error
],
files
]);
self
.
lastCompilationResult
=
null
;
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
{
'error'
:
error
},
files
]);
}
else
{
}
else
{
var
optimize
=
queryParams
.
get
().
optimize
;
var
optimize
=
queryParams
.
get
().
optimize
;
compileJSON
(
input
,
optimize
?
1
:
0
);
compileJSON
(
input
,
optimize
?
1
:
0
);
...
@@ -82,20 +83,34 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -82,20 +83,34 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
function
compilationFinished
(
data
,
missingInputs
,
source
)
{
function
compilationFinished
(
data
,
missingInputs
,
source
)
{
var
noFatalErrors
=
true
;
// ie warnings are ok
var
noFatalErrors
=
true
;
// ie warnings are ok
function
isValidError
(
error
)
{
// The deferred import is not a real error
// FIXME: maybe have a better check?
if
(
/Deferred import/
.
exec
(
error
))
{
return
false
;
}
return
utils
.
errortype
(
error
)
!==
'warning'
;
}
if
(
data
[
'error'
]
!==
undefined
)
{
if
(
data
[
'error'
]
!==
undefined
)
{
if
(
utils
.
errortype
(
data
[
'error'
])
!==
'warning'
)
{
// Ignore warnings (and the 'Deferred import' error as those are generated by us as a workaround
if
(
isValidError
(
data
[
'error'
]))
{
noFatalErrors
=
false
;
noFatalErrors
=
false
;
}
}
}
}
if
(
data
[
'errors'
]
!==
undefined
)
{
if
(
data
[
'errors'
]
!==
undefined
)
{
data
[
'errors'
].
forEach
(
function
(
err
)
{
data
[
'errors'
].
forEach
(
function
(
err
)
{
if
(
utils
.
errortype
(
err
)
!==
'warning'
)
{
// Ignore warnings and the 'Deferred import' error as those are generated by us as a workaround
if
(
isValidError
(
err
))
{
noFatalErrors
=
false
;
noFatalErrors
=
false
;
}
}
});
});
}
}
if
(
!
noFatalErrors
)
{
if
(
!
noFatalErrors
)
{
// There are fatal errors - abort here
self
.
lastCompilationResult
=
null
;
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
)
{
compile
(
missingInputs
);
compile
(
missingInputs
);
...
...
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