File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ class StringReplaceCall extends DataFlow::MethodCallNode {
281281 }
282282
283283 /**
284- * Holds if this is a global replacement, that is, the first argument is a regulare expression
284+ * Holds if this is a global replacement, that is, the first argument is a regular expression
285285 * with the `g` flag.
286286 */
287287 predicate isGlobal ( ) {
@@ -303,7 +303,7 @@ class StringReplaceCall extends DataFlow::MethodCallNode {
303303 replacer .getParameter ( 0 ) .flowsToExpr ( pr .getPropertyNameExpr ( ) ) and
304304 pr = map .getAPropertyRead ( ) and
305305 pr .flowsTo ( replacer .getAReturn ( ) ) and
306- map .asExpr ( ) . ( ObjectExpr ) . getPropertyByName ( old ) . getInit ( ) .getStringValue ( ) = new
306+ map .hasPropertyWrite ( old , any ( DataFlow :: Node repl | repl .getStringValue ( ) = new ) )
307307 )
308308 }
309309}
You can’t perform that action at this time.
0 commit comments