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
0061b3b9
Commit
0061b3b9
authored
Jan 11, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log error if ast not found
parent
87d2227a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
internalCallTree.js
src/util/internalCallTree.js
+11
-6
No files found.
src/util/internalCallTree.js
View file @
0061b3b9
...
...
@@ -91,7 +91,7 @@ async function buildTree (tree, step, scopeId) {
try
{
sourceLocation
=
await
extractSourceLocation
(
tree
,
step
)
}
catch
(
e
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - Error resolving source location. '
+
step
+
' '
+
e
.
message
r
}
return
{
outStep
:
step
,
error
:
'InternalCallTree - Error resolving source location. '
+
step
+
' '
+
e
.
message
}
}
if
(
!
sourceLocation
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - No source Location. '
+
step
}
...
...
@@ -149,11 +149,11 @@ function extractSourceLocation (tree, step) {
if
(
!
error
)
{
return
resolve
(
sourceLocation
)
}
else
{
return
reject
(
'InternalCallTree - Cannot retrieve sourcelocation for step '
+
step
)
return
reject
(
'InternalCallTree - Cannot retrieve sourcelocation for step '
+
step
+
' '
+
error
)
}
})
}
else
{
return
reject
(
'InternalCallTree - Cannot retrieve address for step '
+
step
)
return
reject
(
'InternalCallTree - Cannot retrieve address for step '
+
step
+
' '
+
error
)
}
})
})
...
...
@@ -161,10 +161,15 @@ function extractSourceLocation (tree, step) {
function
resolveVariableDeclaration
(
tree
,
step
,
sourceLocation
)
{
if
(
!
tree
.
variableDeclarationByFile
[
sourceLocation
.
file
])
{
tree
.
variableDeclarationByFile
[
sourceLocation
.
file
]
=
extractVariableDeclarations
(
tree
.
solidityProxy
.
ast
(
sourceLocation
),
tree
.
astWalker
)
var
ast
=
tree
.
solidityProxy
.
ast
(
sourceLocation
)
if
(
ast
)
{
tree
.
variableDeclarationByFile
[
sourceLocation
.
file
]
=
extractVariableDeclarations
(
ast
,
tree
.
astWalker
)
}
else
{
console
.
log
(
'Ast not found for step '
+
step
+
'. file '
+
sourceLocation
.
file
)
return
null
}
}
var
variableDeclarations
=
tree
.
variableDeclarationByFile
[
sourceLocation
.
file
]
return
variableDeclarations
[
sourceLocation
.
start
+
':'
+
sourceLocation
.
length
+
':'
+
sourceLocation
.
file
]
return
tree
.
variableDeclarationByFile
[
sourceLocation
.
file
][
sourceLocation
.
start
+
':'
+
sourceLocation
.
length
+
':'
+
sourceLocation
.
file
]
}
function
extractVariableDeclarations
(
ast
,
astWalker
)
{
...
...
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