Skip to content

Commit ec9a3c8

Browse files
author
Max Schaefer
committed
JavaScript: Do not flag case-insensitive replace.
1 parent 1ab1110 commit ec9a3c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

javascript/ql/src/RegExp/IdentityReplacement.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ import javascript
1717
* `s` and nothing else.
1818
*/
1919
predicate matchesString(Expr e, string s) {
20-
exists (RegExpConstant c |
21-
matchesConstant(e.(RegExpLiteral).getRoot(), c) and
22-
s = c.getValue()
20+
exists (RegExpLiteral rl |
21+
rl = e and
22+
not rl.isIgnoreCase() and
23+
regExpMatchesString(rl.getRoot(), s)
2324
)
2425
or
2526
s = e.getStringValue()

0 commit comments

Comments
 (0)