summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-25 10:14:14 -0500
committerLinus Groh <mail@linusgroh.de>2022-11-30 23:27:51 +0100
commit69f6fbdf994acc6338796f9b6e53fa35a61a0eb0 (patch)
tree7979f61b71b2756400861de0e4e1513f4753dbc1 /Userland/Libraries/LibJS
parent34e328e580ac1852323607045c6c721d197778ad (diff)
downloadserenity-69f6fbdf994acc6338796f9b6e53fa35a61a0eb0.zip
LibJS: Replace CreateDataPropertyOrThrow with Set in TypedArray toSorted
This was an errant transcription in 4dbb2c2d44d.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp4
1 files 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.
}