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 {
121121 * Holds if this is a global replacement, that is, the first argument is a regular expression
122122 * with the `g` flag or unknown flags, or this is a call to `.replaceAll()`.
123123 */
124- predicate maybeGlobal ( ) {
125- RegExp:: maybeGlobal ( this .getRegExp ( ) .tryGetFlags ( ) ) or this .getMethodName ( ) = "replaceAll"
126- }
124+ predicate maybeGlobal ( ) { this .getRegExp ( ) .maybeGlobal ( ) or this .getMethodName ( ) = "replaceAll" }
127125
128126 /**
129127 * 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 {
16851685 /** Holds if the constructed predicate has the `g` flag. */
16861686 predicate isGlobal ( ) { RegExp:: isGlobal ( this .getFlags ( ) ) }
16871687
1688+ /** Holds if the constructed predicate has the `g` flag or unknown flags. */
1689+ predicate maybeGlobal ( ) { RegExp:: maybeGlobal ( this .tryGetFlags ( ) ) }
1690+
16881691 /** Gets a data flow node referring to this regular expression. */
16891692 private DataFlow:: SourceNode getAReference ( DataFlow:: TypeTracker t ) {
16901693 t .start ( ) and
You can’t perform that action at this time.
0 commit comments