JavaScript: Introduce DataFlow::ExprNode and exprNode for consistency with other languages.

This commit is contained in:
Max Schaefer
2019-05-20 15:55:03 +01:00
parent 6468721f76
commit 2cb33f6088
2 changed files with 10 additions and 0 deletions

View File

@@ -980,6 +980,11 @@ module DataFlow {
*/
ValueNode valueNode(ASTNode nd) { result.getAstNode() = nd }
/**
* Gets the data flow node corresponding to `e`.
*/
ExprNode exprNode(Expr e) { result = valueNode(e) }
/** Gets the data flow node corresponding to `ssa`. */
SsaDefinitionNode ssaDefinitionNode(SsaDefinition ssa) { result = TSsaDefNode(ssa) }

View File

@@ -6,6 +6,11 @@
import javascript
/** A data flow node corresponding to an expression. */
class ExprNode extends DataFlow::ValueNode {
override Expr astNode;
}
/** A data flow node corresponding to a parameter. */
class ParameterNode extends DataFlow::SourceNode {
Parameter p;