mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
JS: Restrict RegExp queries to actual regular expressions
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user