mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibJS: Use the match's global offset for 'index' in RegExp.exec()
This was not noticed before because all the previous matches were single-line.
This commit is contained in:
parent
a697a2a37a
commit
2ef5b138ee
Notes:
sideshowbarker
2024-07-18 19:13:24 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/2ef5b138ee3 Pull-request: https://github.com/SerenityOS/serenity/pull/6566 Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 1 deletions
|
@ -168,7 +168,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::exec)
|
|||
// FIXME: Do code point index correction if the Unicode flag is set.
|
||||
auto* array = Array::create(global_object);
|
||||
array->indexed_properties().set_array_like_size(result.n_capture_groups + 1);
|
||||
array->define_property(vm.names.index, Value((i32)match.column));
|
||||
array->define_property(vm.names.index, Value((i32)match.global_offset));
|
||||
array->define_property(vm.names.input, js_string(vm, str));
|
||||
array->indexed_properties().put(array, 0, js_string(vm, match.view.to_string()));
|
||||
|
||||
|
|
Loading…
Reference in a new issue