1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibRegex: Ensure escaped code points are exactly 4 digits in length

This commit is contained in:
Timothy Flynn 2021-08-11 09:58:08 -04:00 committed by Linus Groh
parent e887314472
commit 2e4b6fd1ac
3 changed files with 12 additions and 7 deletions

View file

@ -503,6 +503,8 @@ TEST_CASE(ECMA262_parse)
{ "(?", regex::Error::InvalidCaptureGroup },
{ "\\u1234", regex::Error::NoError, regex::ECMAScriptFlags::Unicode },
{ "[\\u1234]", regex::Error::NoError, regex::ECMAScriptFlags::Unicode },
{ "\\u1", regex::Error::InvalidPattern, regex::ECMAScriptFlags::Unicode },
{ "[\\u1]", regex::Error::InvalidPattern, regex::ECMAScriptFlags::Unicode },
{ ",(?", regex::Error::InvalidCaptureGroup }, // #4583
{ "{1}", regex::Error::InvalidPattern },
{ "{1,2}", regex::Error::InvalidPattern },