From 69f6fbdf994acc6338796f9b6e53fa35a61a0eb0 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 25 Nov 2022 10:14:14 -0500 Subject: [PATCH] LibJS: Replace CreateDataPropertyOrThrow with Set in TypedArray toSorted This was an errant transcription in 4dbb2c2d44d. --- Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index cc90c3883a..10d2c920a7 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -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. }