JS: Restrict RegExp queries to actual regular expressions

This commit is contained in:
Asger F
2019-10-22 13:52:02 +01:00
parent b8711fc642
commit c21d095d38
12 changed files with 83 additions and 40 deletions

View File

@@ -108,11 +108,7 @@ class RegExpRoot extends RegExpTerm {
// there are no lookbehinds
not exists(RegExpLookbehind lbh | getRoot(lbh) = this) and
// is actually used as a RegExp
(
parent instanceof RegExpLiteral
or
parent.(StringLiteral).flow() instanceof RegExpPatternSource
)
isUsedAsRegExp()
}
}