compute reducedTraceBySourceLocation

pull/7/head
yann300 8 years ago
parent 4dfdb2b1e9
commit 00cd1e71a2
  1. 9
      src/util/internalCallTree.js

@ -58,6 +58,7 @@ class InternalCallTree {
this.scopeStarts = {}
this.variableDeclarationByFile = {}
this.astWalker = new AstWalker()
this.reducedTraceBySourceLocation = []
}
/**
@ -90,6 +91,14 @@ async function buildTree (tree, step, scopeId) {
var sourceLocation
try {
sourceLocation = await extractSourceLocation(tree, step)
var previous = this.reducedTraceBySourceLocation[this.reducedTraceBySourceLocation.length - 1]
if (previous &&
(sourceLocation.jump !== previous.jump ||
sourceLocation.start !== previous.start ||
sourceLocation.length !== previous.length ||
sourceLocation.file !== previous.file)) {
this.reducedTraceBySourceLocation.push(step)
}
} catch (e) {
return { outStep: step, error: 'InternalCallTree - Error resolving source location. ' + step + ' ' + e.message }
}

Loading…
Cancel
Save