File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -121,9 +121,7 @@ class StringReplaceCall extends DataFlow::MethodCallNode {
121
121
* Holds if this is a global replacement, that is, the first argument is a regular expression
122
122
* with the `g` flag or unknown flags, or this is a call to `.replaceAll()`.
123
123
*/
124
- predicate maybeGlobal ( ) {
125
- RegExp:: maybeGlobal ( this .getRegExp ( ) .tryGetFlags ( ) ) or this .getMethodName ( ) = "replaceAll"
126
- }
124
+ predicate maybeGlobal ( ) { this .getRegExp ( ) .maybeGlobal ( ) or this .getMethodName ( ) = "replaceAll" }
127
125
128
126
/**
129
127
* Holds if this call to `replace` replaces `old` with `new`.
Original file line number Diff line number Diff line change @@ -1685,6 +1685,9 @@ class RegExpCreationNode extends DataFlow::SourceNode {
1685
1685
/** Holds if the constructed predicate has the `g` flag. */
1686
1686
predicate isGlobal ( ) { RegExp:: isGlobal ( this .getFlags ( ) ) }
1687
1687
1688
+ /** Holds if the constructed predicate has the `g` flag or unknown flags. */
1689
+ predicate maybeGlobal ( ) { RegExp:: maybeGlobal ( this .tryGetFlags ( ) ) }
1690
+
1688
1691
/** Gets a data flow node referring to this regular expression. */
1689
1692
private DataFlow:: SourceNode getAReference ( DataFlow:: TypeTracker t ) {
1690
1693
t .start ( ) and
You can’t perform that action at this time.
0 commit comments