mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
LibRegex: Make Match::capture_group_name an index into the string table
This removes another Match member that required destruction. The "API" for accessing the strings is definitely a bit awkward. We'll think of something nicer eventually.
This commit is contained in:
parent
9d47cc54f8
commit
54edf29f1b
Notes:
github-actions[bot]
2025-04-14 15:41:26 +00:00
Author: https://github.com/awesomekling
Commit: 54edf29f1b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4351
5 changed files with 11 additions and 10 deletions
|
@ -330,7 +330,7 @@ static ThrowCompletionOr<Value> regexp_builtin_exec(VM& vm, RegExpObject& regexp
|
|||
// e. If the ith capture of R was defined with a GroupName, then
|
||||
if (capture.capture_group_name.has_value()) {
|
||||
// i. Let s be the CapturingGroupName of the corresponding RegExpIdentifierName.
|
||||
auto group_name = capture.capture_group_name.release_value();
|
||||
auto group_name = regex.parser_result.bytecode.get_string(capture.capture_group_name.release_value());
|
||||
|
||||
// ii. Perform ! CreateDataPropertyOrThrow(groups, s, capturedValue).
|
||||
MUST(groups_object->create_data_property_or_throw(group_name, captured_value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue