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
ce1beb18
Unverified
Commit
ce1beb18
authored
Dec 14, 2017
by
yann300
Committed by
GitHub
Dec 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #636 from ethereum/fixAnalysisThrow
Catch exception in analysis module
parents
a6ef945c
593e319b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
staticAnalysisRunner.js
remix-solidity/src/analysis/staticAnalysisRunner.js
+17
-4
No files found.
remix-solidity/src/analysis/staticAnalysisRunner.js
View file @
ce1beb18
...
...
@@ -16,13 +16,20 @@ staticAnalysisRunner.prototype.run = function (compilationResult, toRun, callbac
}
staticAnalysisRunner
.
prototype
.
runWithModuleList
=
function
(
compilationResult
,
modules
,
callback
)
{
var
reports
=
[]
// Also provide convenience analysis via the AST walker.
var
walker
=
new
AstWalker
()
for
(
var
k
in
compilationResult
.
sources
)
{
walker
.
walk
(
compilationResult
.
sources
[
k
].
legacyAST
,
{
'*'
:
function
(
node
)
{
modules
.
map
(
function
(
item
,
i
)
{
if
(
item
.
mod
.
visit
!==
undefined
)
{
item
.
mod
.
visit
(
node
)
try
{
item
.
mod
.
visit
(
node
)
}
catch
(
e
)
{
reports
.
push
({
name
:
item
.
name
,
report
:
[{
warning
:
'INTERNAL ERROR in module '
+
item
.
name
+
' '
+
e
.
message
}]
})
}
}
})
return
true
...
...
@@ -31,9 +38,15 @@ staticAnalysisRunner.prototype.runWithModuleList = function (compilationResult,
// Here, modules can just collect the results from the AST walk,
// but also perform new analysis.
var
reports
=
modules
.
map
(
function
(
item
,
i
)
{
return
{
name
:
item
.
name
,
report
:
item
.
mod
.
report
(
compilationResult
)
}
})
reports
=
reports
.
concat
(
modules
.
map
(
function
(
item
,
i
)
{
var
report
=
null
try
{
report
=
item
.
mod
.
report
(
compilationResult
)
}
catch
(
e
)
{
report
=
[{
warning
:
'INTERNAL ERROR in module '
+
item
.
name
+
' '
+
e
.
message
}]
}
return
{
name
:
item
.
name
,
report
:
report
}
}))
callback
(
reports
)
}
...
...
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