store only array of step

pull/7/head
yann300 8 years ago
parent d35ba6eb4b
commit 922fe98794
  1. 14
      src/util/internalCallTree.js

@ -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 }

Loading…
Cancel
Save