mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
JS: Add test case for wide constants in char class
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| tst.js:1:1:1:9 | /[\\u12340\\udf40-\\u12345\\udf45]/ | Character class with supplementary characters in non-unicode literal. |
|
||||
@@ -0,0 +1,12 @@
|
||||
import javascript
|
||||
|
||||
from RegExpLiteral literal, RegExpConstant wideConstant
|
||||
where wideConstant.getLiteral() = literal and
|
||||
not literal.getFlags().matches("%u%") and
|
||||
wideConstant.getValue().length() > 1 and
|
||||
(
|
||||
wideConstant.getParent() instanceof RegExpCharacterClass
|
||||
or
|
||||
wideConstant.getParent() instanceof RegExpCharacterRange
|
||||
)
|
||||
select literal, "Character class with supplementary characters in non-unicode literal."
|
||||
@@ -0,0 +1,2 @@
|
||||
/[𒍀-𒍅]/; // NOT OK
|
||||
/[𒍀-𒍅]/u; // OK
|
||||
Reference in New Issue
Block a user