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
416cd3bb
Commit
416cd3bb
authored
Feb 20, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add external call ref to internalcalltree
parent
76f8485b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
internalCallTree.js
src/util/internalCallTree.js
+19
-7
No files found.
src/util/internalCallTree.js
View file @
416cd3bb
...
...
@@ -106,7 +106,15 @@ class InternalCallTree {
async
function
buildTree
(
tree
,
step
,
scopeId
)
{
let
subScope
=
1
tree
.
scopeStarts
[
step
]
=
scopeId
tree
.
scopes
[
scopeId
]
=
{
firstStep
:
step
,
locals
:
{}
}
tree
.
scopes
[
scopeId
]
=
{
firstStep
:
step
,
locals
:
{}
}
function
checkDepth
(
step
,
trace
)
{
if
(
step
+
1
<
trace
.
length
)
{
return
trace
[
step
].
depth
!==
trace
[
step
+
1
].
depth
}
return
false
}
var
currentSourceLocation
=
{}
while
(
step
<
tree
.
traceManager
.
trace
.
length
)
{
var
sourceLocation
...
...
@@ -124,19 +132,23 @@ async function buildTree (tree, step, scopeId) {
if
(
!
sourceLocation
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - No source Location. '
+
step
}
}
if
(
sourceLocation
.
jump
===
'i'
)
{
if
(
traceHelper
.
isCallInstruction
(
tree
.
traceManager
.
trace
[
step
])
||
sourceLocation
.
jump
===
'i'
)
{
try
{
var
result
=
await
buildTree
(
tree
,
step
+
1
,
scopeId
===
''
?
subScope
.
toString
()
:
scopeId
+
'.'
+
subScope
)
if
(
result
.
error
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
result
.
error
}
if
(
sourceLocation
.
jump
===
'i'
)
{
step
++
}
var
externalCallResult
=
await
buildTree
(
tree
,
step
,
scopeId
===
''
?
subScope
.
toString
()
:
scopeId
+
'.'
+
subScope
)
if
(
externalCallResult
.
error
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
externalCallResult
.
error
}
}
else
{
step
=
r
esult
.
outStep
step
=
externalCallR
esult
.
outStep
subScope
++
}
}
catch
(
e
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
e
.
message
}
}
}
else
if
(
sourceLocation
.
jump
===
'o'
)
{
}
else
if
(
sourceLocation
.
jump
===
'o'
||
checkDepth
(
step
,
tree
.
traceManager
.
trace
)
)
{
tree
.
scopes
[
scopeId
].
lastStep
=
step
return
{
outStep
:
step
+
1
}
}
else
{
...
...
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