JS: Fix parsing of non-BMP chars before a quantifier

This commit is contained in:
Asger F
2019-11-13 16:03:18 +00:00
parent 8fcf7a265a
commit 37aa85fe81
4 changed files with 20 additions and 3 deletions

View File

@@ -1 +1,2 @@
| tst.js:1:1:1:9 | /[\\u12340\\udf40-\\u12345\\udf45]/ | Character class with supplementary characters in non-unicode literal. |
| tst.js:1:1:1:9 | /[\\u12340\\udf40-\\u12345\\udf45]/ | Split supplementary character in non-unicode literal. |
| tst.js:3:1:3:5 | /\\u12340\\udf40+/ | Split supplementary character in non-unicode literal. |

View File

@@ -8,5 +8,7 @@ where wideConstant.getLiteral() = literal and
wideConstant.getParent() instanceof RegExpCharacterClass
or
wideConstant.getParent() instanceof RegExpCharacterRange
or
wideConstant.getParent() instanceof RegExpQuantifier
)
select literal, "Character class with supplementary characters in non-unicode literal."
select literal, "Split supplementary character in non-unicode literal."

View File

@@ -1,2 +1,5 @@
/[𒍀-𒍅]/; // NOT OK
/[𒍀-𒍅]/u; // OK
/𒍀+/; // NOT OK
/𒍀+/u; // OK
/(𒍀)+/; // OK