add support for String.prototype.replaceAll

This commit is contained in:
Erik Krogh Kristensen
2020-09-17 14:00:44 +02:00
parent 0dbdbfa659
commit b09015380a
17 changed files with 41 additions and 36 deletions

View File

@@ -70,7 +70,7 @@ predicate regExpMatchesString(RegExpTerm t, string s) {
from MethodCallExpr repl, string s, string friendly
where
repl.getMethodName() = "replace" and
repl.getMethodName() = ["replace", "replaceAll"] and
matchesString(repl.getArgument(0), s) and
repl.getArgument(1).getStringValue() = s and
(if s = "" then friendly = "the empty string" else friendly = "'" + s + "'")