Skip to content

Commit 2cb33f6

Browse files
author
Max Schaefer
committed
JavaScript: Introduce DataFlow::ExprNode and exprNode for consistency with other languages.
1 parent 6468721 commit 2cb33f6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,11 @@ module DataFlow {
980980
*/
981981
ValueNode valueNode(ASTNode nd) { result.getAstNode() = nd }
982982

983+
/**
984+
* Gets the data flow node corresponding to `e`.
985+
*/
986+
ExprNode exprNode(Expr e) { result = valueNode(e) }
987+
983988
/** Gets the data flow node corresponding to `ssa`. */
984989
SsaDefinitionNode ssaDefinitionNode(SsaDefinition ssa) { result = TSsaDefNode(ssa) }
985990

javascript/ql/src/semmle/javascript/dataflow/Nodes.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
import javascript
88

9+
/** A data flow node corresponding to an expression. */
10+
class ExprNode extends DataFlow::ValueNode {
11+
override Expr astNode;
12+
}
13+
914
/** A data flow node corresponding to a parameter. */
1015
class ParameterNode extends DataFlow::SourceNode {
1116
Parameter p;

0 commit comments

Comments
 (0)