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
1e5e4e8f
Commit
1e5e4e8f
authored
Jan 05, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add findCall
parent
92666bf9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
util.js
src/helpers/util.js
+22
-0
No files found.
src/helpers/util.js
View file @
1e5e4e8f
...
@@ -83,5 +83,27 @@ module.exports = {
...
@@ -83,5 +83,27 @@ module.exports = {
findLowerBoundValue
:
function
(
target
,
array
)
{
findLowerBoundValue
:
function
(
target
,
array
)
{
var
index
=
this
.
findLowerBound
(
target
,
array
)
var
index
=
this
.
findLowerBound
(
target
,
array
)
return
index
>=
0
?
array
[
index
]
:
null
return
index
>=
0
?
array
[
index
]
:
null
},
findCall
:
findCall
}
/**
* Find the call from @args rootCall which contains @args index (recursive)
*
* @param {Int} index - index of the vmtrace
* @param {Object} rootCall - call tree, built by the trace analyser
* @return {Object} - return the call which include the @args index
*/
function
findCall
(
index
,
rootCall
)
{
var
calls
=
Object
.
keys
(
rootCall
.
calls
)
var
ret
=
rootCall
for
(
var
k
in
calls
)
{
var
subCall
=
rootCall
.
calls
[
calls
[
k
]]
if
(
index
>=
subCall
.
start
&&
index
<=
subCall
.
return
)
{
ret
=
findCall
(
index
,
subCall
)
break
}
}
}
return
ret
}
}
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