Commit 2374330f authored by yann300's avatar yann300

fix find scope in internalcalltree

parent 962c1409
...@@ -32,13 +32,15 @@ class InternalCallTree { ...@@ -32,13 +32,15 @@ class InternalCallTree {
findScope (vmtraceIndex) { findScope (vmtraceIndex) {
var scopeId = util.findLowerBoundValue(vmtraceIndex, Object.keys(this.scopeStarts)) var scopeId = util.findLowerBoundValue(vmtraceIndex, Object.keys(this.scopeStarts))
var scopes = this.scopes[scopeId] scopeId = this.scopeStarts[scopeId]
var reg = /(.\d)$/ var scope = this.scopes[scopeId]
while (scopes.lastStep < vmtraceIndex) { var reg = /(.\d|\d)$/
scopeId = scopeId.match(reg) while (scope.lastStep && scope.lastStep < vmtraceIndex) {
scopes = this.scopes[scopeId[1]] var matched = scopeId.match(reg)
} scopeId = scopeId.replace(matched[1], '')
return scopes scope = this.scopes[scopeId]
}
return scope
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment