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

LibJS: Replace CreateDataPropertyOrThrow with Set in TypedArray toSorted

This was an errant transcription in 4dbb2c2d44.
This commit is contained in:
Timothy Flynn 2022-11-25 10:14:14 -05:00 committed by Linus Groh
parent 34e328e580
commit 69f6fbdf99

View file

@ -1640,8 +1640,8 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::to_sorted)
// 9. Let j be 0.
// 10. Repeat, while j < len,
for (size_t j = 0; j < length; j++) {
// Perform ! Set(A, ! ToString(𝔽(j)), sortedList[j], true).
MUST(return_array->create_data_property_or_throw(j, sorted_list[j]));
// a. Perform ! Set(A, ! ToString(𝔽(j)), sortedList[j], true).
MUST(return_array->set(j, sorted_list[j], Object::ShouldThrowExceptions::Yes));
// b. Set j to j + 1.
}