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
ffbd855c
Commit
ffbd855c
authored
Jan 05, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
put includion of variable declaration in a separate function
parent
f51b56d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
internalCallTree.js
src/util/internalCallTree.js
+21
-17
No files found.
src/util/internalCallTree.js
View file @
ffbd855c
...
@@ -109,23 +109,7 @@ async function buildTree (tree, step, scopeId) {
...
@@ -109,23 +109,7 @@ async function buildTree (tree, step, scopeId) {
return
{
outStep
:
step
+
1
}
return
{
outStep
:
step
+
1
}
}
else
{
}
else
{
if
(
tree
.
includeLocalVariables
)
{
if
(
tree
.
includeLocalVariables
)
{
var
variableDeclaration
=
resolveVariableDeclaration
(
tree
,
step
,
sourceLocation
)
includeVariableDeclaration
(
tree
,
step
,
sourceLocation
,
scopeId
)
if
(
variableDeclaration
&&
!
tree
.
scopes
[
scopeId
].
locals
[
variableDeclaration
.
attributes
.
name
])
{
tree
.
traceManager
.
getStackAt
(
step
,
(
error
,
stack
)
=>
{
if
(
!
error
)
{
tree
.
solidityProxy
.
contractNameAt
(
step
,
(
error
,
contractName
)
=>
{
// cached
if
(
!
error
)
{
var
states
=
tree
.
solidityProxy
.
extractStatesDefinitions
()
tree
.
scopes
[
scopeId
].
locals
[
variableDeclaration
.
attributes
.
name
]
=
{
name
:
variableDeclaration
.
attributes
.
name
,
type
:
decodeInfo
.
parseType
(
variableDeclaration
.
attributes
.
type
,
states
,
contractName
),
stackHeight
:
stack
.
length
}
}
})
}
})
}
}
}
step
++
step
++
}
}
...
@@ -133,6 +117,26 @@ async function buildTree (tree, step, scopeId) {
...
@@ -133,6 +117,26 @@ async function buildTree (tree, step, scopeId) {
return
{
outStep
:
step
}
return
{
outStep
:
step
}
}
}
function
includeVariableDeclaration
(
tree
,
step
,
sourceLocation
,
scopeId
)
{
var
variableDeclaration
=
resolveVariableDeclaration
(
tree
,
step
,
sourceLocation
)
if
(
variableDeclaration
&&
!
tree
.
scopes
[
scopeId
].
locals
[
variableDeclaration
.
attributes
.
name
])
{
tree
.
traceManager
.
getStackAt
(
step
,
(
error
,
stack
)
=>
{
if
(
!
error
)
{
tree
.
solidityProxy
.
contractNameAt
(
step
,
(
error
,
contractName
)
=>
{
// cached
if
(
!
error
)
{
var
states
=
tree
.
solidityProxy
.
extractStatesDefinitions
()
tree
.
scopes
[
scopeId
].
locals
[
variableDeclaration
.
attributes
.
name
]
=
{
name
:
variableDeclaration
.
attributes
.
name
,
type
:
decodeInfo
.
parseType
(
variableDeclaration
.
attributes
.
type
,
states
,
contractName
),
stackHeight
:
stack
.
length
}
}
})
}
})
}
}
function
extractSourceLocation
(
tree
,
step
)
{
function
extractSourceLocation
(
tree
,
step
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
tree
.
traceManager
.
getCurrentCalledAddressAt
(
step
,
(
error
,
address
)
=>
{
tree
.
traceManager
.
getCurrentCalledAddressAt
(
step
,
(
error
,
address
)
=>
{
...
...
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