JavaScript: Introduce class RegExpLiteralNode.

This commit is contained in:
Max Schaefer
2019-11-05 13:19:21 +00:00
parent 12ea81af9c
commit f43e843b20

View File

@@ -530,6 +530,24 @@ class ArrayLiteralNode extends DataFlow::ValueNode, DataFlow::SourceNode {
int getSize() { result = astNode.getSize() }
}
/**
* A data-flow node corresponding to a regular-expression literal.
*
* Examples:
* ```js
* /https?/i
* ```
*/
class RegExpLiteralNode extends DataFlow::ValueNode, DataFlow::SourceNode {
override RegExpLiteral astNode;
/** Holds if this regular expression has a `g` flag. */
predicate isGlobal() { astNode.isGlobal() }
/** Gets the root term of this regular expression. */
RegExpTerm getRoot() { result = astNode.getRoot() }
}
/**
* A data flow node corresponding to a `new Array()` or `Array()` invocation.
*