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

LibJS: Hook up Regex<ECMA262> to RegExpObject and implement `test()'

This makes RegExpObject compile and store a Regex<ECMA262>, adds
all flag-related properties, and implements `RegExpPrototype.test()`
(complete with 'lastIndex' support) :^)
It should be noted that this only implements `test()' using the builtin
`exec()'.
This commit is contained in:
AnotherTest 2020-11-19 01:50:00 +03:30 committed by Andreas Kling
parent 75081b2bdd
commit 8ba273a2f3
13 changed files with 396 additions and 12 deletions

View file

@ -261,6 +261,7 @@ public:
struct MatchInput {
RegexStringView view { nullptr };
AllOptions regex_options {};
size_t start_offset { 0 }; // For Stateful matches, saved and restored from Regex::start_offset.
size_t match_index { 0 };
size_t line { 0 };