summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-05-03 21:19:16 +0200
committerLinus Groh <mail@linusgroh.de>2022-05-03 22:49:31 +0200
commit438e3ceb4a407a9718e51521ea15bcb88d1b373c (patch)
treed3aa2ca1ae3cc6c5574c4abeedbf7102845de5cf /Userland/Libraries/LibJS
parent812aa1a99c1e4fb4b9ccbf1553071f275a34c10b (diff)
downloadserenity-438e3ceb4a407a9718e51521ea15bcb88d1b373c.zip
LibJS: Use CreateDataPropertyOrThrow in MakeMatchIndicesIndexPairArray
This was part of a normative change in the ECMA-262 spec, but didn't get updated when we implemented that. See: https://github.com/tc39/ecma262/commit/0209d85
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp
index 4f5ce2c2c3..7a42c95f88 100644
--- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp
@@ -141,21 +141,21 @@ static Value make_match_indices_index_pair_array(GlobalObject& global_object, Ut
if (match_indices.has_value())
match_indices_array = get_match_index_par(global_object, string, *match_indices);
- // d. Perform ! CreateDataProperty(A, ! ToString(i), matchIndicesArray).
- MUST(array->create_data_property(i, match_indices_array));
+ // d. Perform ! CreateDataPropertyOrThrow(A, ! ToString(i), matchIndicesArray).
+ MUST(array->create_data_property_or_throw(i, match_indices_array));
}
for (auto const& entry : group_names) {
auto match_indices_array = get_match_index_par(global_object, string, entry.value);
// e. If i > 0 and groupNames[i - 1] is not undefined, then
- // i. Perform ! CreateDataProperty(groups, groupNames[i - 1], matchIndicesArray).
- MUST(groups.as_object().create_data_property(entry.key, match_indices_array));
+ // ii. Perform ! CreateDataPropertyOrThrow(groups, groupNames[i - 1], matchIndicesArray).
+ MUST(groups.as_object().create_data_property_or_throw(entry.key, match_indices_array));
}
- // 8. Perform ! CreateDataProperty(A, "groups", groups).
+ // 8. Perform ! CreateDataPropertyOrThrow(A, "groups", groups).
// NOTE: This step must be performed after the above loops in order for groups to be populated.
- MUST(array->create_data_property(vm.names.groups, groups));
+ MUST(array->create_data_property_or_throw(vm.names.groups, groups));
// 10. Return A.
return array;