File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,9 @@ class StringReplaceCall extends DataFlow::MethodCallNode {
115115 * Holds if this is a global replacement, that is, the first argument is a regular expression
116116 * with the `g` flag, or this is a call to `.replaceAll()`.
117117 */
118- predicate isGlobal ( ) { this .getRegExp ( ) .isGlobal ( ) or this .getMethodName ( ) = "replaceAll" }
118+ predicate isGlobal ( ) {
119+ RegExp:: isGlobal ( this .getRegExp ( ) .getFlags ( ) ) or this .getMethodName ( ) = "replaceAll"
120+ }
119121
120122 /**
121123 * Holds if this call to `replace` replaces `old` with `new`.
Original file line number Diff line number Diff line change @@ -1682,9 +1682,6 @@ class RegExpCreationNode extends DataFlow::SourceNode {
16821682 result = this .( RegExpLiteralNode ) .getFlags ( )
16831683 }
16841684
1685- /** Holds if the constructed predicate has the `g` flag. */
1686- predicate isGlobal ( ) { RegExp:: isGlobal ( this .getFlags ( ) ) }
1687-
16881685 /** Gets a data flow node referring to this regular expression. */
16891686 private DataFlow:: SourceNode getAReference ( DataFlow:: TypeTracker t ) {
16901687 t .start ( ) and
You can’t perform that action at this time.
0 commit comments