Commit 922fe987 authored by yann300's avatar yann300

store only array of step

parent d35ba6eb
...@@ -87,17 +87,17 @@ async function buildTree (tree, step, scopeId) { ...@@ -87,17 +87,17 @@ async function buildTree (tree, step, scopeId) {
let subScope = 1 let subScope = 1
tree.scopeStarts[step] = scopeId tree.scopeStarts[step] = scopeId
tree.scopes[scopeId] = { firstStep: step, locals: {} } tree.scopes[scopeId] = { firstStep: step, locals: {} }
var currentSourceLocation = {}
while (step < tree.traceManager.trace.length) { while (step < tree.traceManager.trace.length) {
var sourceLocation var sourceLocation
try { try {
sourceLocation = await extractSourceLocation(tree, step) sourceLocation = await extractSourceLocation(tree, step)
var previous = this.reducedTraceBySourceLocation[this.reducedTraceBySourceLocation.length - 1] if (sourceLocation.jump !== currentSourceLocation.jump ||
if (previous && sourceLocation.start !== currentSourceLocation.start ||
(sourceLocation.jump !== previous.jump || sourceLocation.length !== currentSourceLocation.length ||
sourceLocation.start !== previous.start || sourceLocation.file !== currentSourceLocation.file) {
sourceLocation.length !== previous.length || tree.reducedTraceBySourceLocation.push(step)
sourceLocation.file !== previous.file)) { currentSourceLocation = sourceLocation
this.reducedTraceBySourceLocation.push(step)
} }
} catch (e) { } catch (e) {
return { outStep: step, error: 'InternalCallTree - Error resolving source location. ' + step + ' ' + e.message } return { outStep: step, error: 'InternalCallTree - Error resolving source location. ' + step + ' ' + e.message }
......
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