mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Merge pull request #18794 from erik-krogh/v-flag
JS: Add support for the regex V flag
This commit is contained in:
4
javascript/ql/lib/change-notes/2025-02-16-v-flag.md
Normal file
4
javascript/ql/lib/change-notes/2025-02-16-v-flag.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* Added support for regular expressions using the `v` flag.
|
||||
@@ -481,6 +481,9 @@ class RegExpLiteral extends @regexp_literal, Literal, RegExpParent {
|
||||
/** Holds if this regular expression has an `s` flag. */
|
||||
predicate isDotAll() { RegExp::isDotAll(this.getFlags()) }
|
||||
|
||||
/** Holds if this regular expression has an `v` flag. */
|
||||
predicate isUnicodeSets() { RegExp::isUnicodeSets(this.getFlags()) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "RegExpLiteral" }
|
||||
}
|
||||
|
||||
|
||||
@@ -1162,6 +1162,10 @@ module RegExp {
|
||||
bindingset[flags]
|
||||
predicate isDotAll(string flags) { flags.matches("%s%") }
|
||||
|
||||
/** Holds if `flags` includes the `v` flag. */
|
||||
bindingset[flags]
|
||||
predicate isUnicodeSets(string flags) { flags.matches("%v%") }
|
||||
|
||||
/** Holds if `flags` includes the `m` flag or is the unknown flag `?`. */
|
||||
bindingset[flags]
|
||||
predicate maybeMultiline(string flags) { flags = unknownFlag() or isMultiline(flags) }
|
||||
|
||||
Reference in New Issue
Block a user