diff --git a/javascript/ql/lib/semmle/javascript/StandardLibrary.qll b/javascript/ql/lib/semmle/javascript/StandardLibrary.qll index b40f10d93691..f33efd59f779 100644 --- a/javascript/ql/lib/semmle/javascript/StandardLibrary.qll +++ b/javascript/ql/lib/semmle/javascript/StandardLibrary.qll @@ -115,7 +115,9 @@ class StringReplaceCall extends DataFlow::MethodCallNode { * Holds if this is a global replacement, that is, the first argument is a regular expression * with the `g` flag, or this is a call to `.replaceAll()`. */ - predicate isGlobal() { this.getRegExp().isGlobal() or this.getMethodName() = "replaceAll" } + predicate isGlobal() { + RegExp::isGlobal(this.getRegExp().getFlags()) or this.getMethodName() = "replaceAll" + } /** * Holds if this call to `replace` replaces `old` with `new`. diff --git a/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll b/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll index d88dab4d4317..59ed567e392c 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll @@ -1682,9 +1682,6 @@ class RegExpCreationNode extends DataFlow::SourceNode { result = this.(RegExpLiteralNode).getFlags() } - /** Holds if the constructed predicate has the `g` flag. */ - predicate isGlobal() { RegExp::isGlobal(this.getFlags()) } - /** Gets a data flow node referring to this regular expression. */ private DataFlow::SourceNode getAReference(DataFlow::TypeTracker t) { t.start() and