JS: Hide captured nodes in path explanations

This commit is contained in:
Asger Feldthaus
2020-04-08 19:58:36 +01:00
parent 1f496d3c6b
commit 47934310ef
2 changed files with 12 additions and 0 deletions

View File

@@ -1462,6 +1462,9 @@ class MidPathNode extends PathNode, MkMidNode {
or
// Skip the synthetic 'this' node, as a ThisExpr will be the next node anyway
nd = DataFlow::thisNode(_)
or
// Skip captured variable nodes as the successor will be a use of that variable anyway.
nd = DataFlow::capturedVariableNode(_)
}
}

View File

@@ -1245,6 +1245,15 @@ module DataFlow {
}
}
/**
* INTERNAL. DO NOT USE.
*
* Gets a data flow node representing the given captured variable.
*/
Node capturedVariableNode(LocalVariable variable) {
result = TCapturedVariableNode(variable)
}
/**
* Gets the data flow node corresponding to `nd`.
*