1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

LibRegex: Implement an ECMA262 Regex quirk with negative lookarounds

This implements the quirk defined by "Note 3" in section "Canonicalize"
(https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch).

Crosses off another quirk from #6042.
This commit is contained in:
Ali Mohammad Pur 2022-01-21 14:30:47 +03:30 committed by Ali Mohammad Pur
parent bfe8f312f3
commit c11be92e23
4 changed files with 54 additions and 16 deletions

View file

@ -682,6 +682,7 @@ TEST_CASE(ECMA262_match)
{ "[\\0]"sv, "\0"sv, true, combine_flags(ECMAScriptFlags::Unicode, ECMAScriptFlags::BrowserExtended) },
{ "[\\01]"sv, "\1"sv, true, ECMAScriptFlags::BrowserExtended },
{ "(\0|a)"sv, "a"sv, true }, // #9686, Should allow null bytes in pattern
{ "(.*?)a(?!(a+)b\\2c)\\2(.*)"sv, "baaabaac"sv, true }, // #6042, Groups inside lookarounds may be referenced outside, but their contents appear empty if the pattern in the lookaround fails.
};
// clang-format on