Commit 00cd1e71 authored by yann300's avatar yann300

compute reducedTraceBySourceLocation

parent 4dfdb2b1
......@@ -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 }
}
......
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