diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-11-25 10:14:14 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-11-30 23:27:51 +0100 |
commit | 69f6fbdf994acc6338796f9b6e53fa35a61a0eb0 (patch) | |
tree | 7979f61b71b2756400861de0e4e1513f4753dbc1 /Userland/Libraries/LibJS | |
parent | 34e328e580ac1852323607045c6c721d197778ad (diff) | |
download | serenity-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.cpp | 4 |
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. } |