1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

LibRegex: Ensure escaped hexadecimals are exactly 2 digits in length

This commit is contained in:
Timothy Flynn 2021-08-11 11:18:57 -04:00 committed by Linus Groh
parent 2e4b6fd1ac
commit 0c8f2f5aca
2 changed files with 6 additions and 2 deletions

View file

@ -499,6 +499,10 @@ TEST_CASE(ECMA262_parse)
{ "\\/" }, // #4189
{ ",/=-:" }, // #4243
{ "\\x" }, // Even invalid escapes are allowed if ~unicode.
{ "\\x1" }, // Even invalid escapes are allowed if ~unicode.
{ "\\x1", regex::Error::InvalidPattern, regex::ECMAScriptFlags::Unicode },
{ "\\x11" },
{ "\\x11", regex::Error::NoError, regex::ECMAScriptFlags::Unicode },
{ "\\", regex::Error::InvalidTrailingEscape },
{ "(?", regex::Error::InvalidCaptureGroup },
{ "\\u1234", regex::Error::NoError, regex::ECMAScriptFlags::Unicode },