summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-12 21:16:54 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-12 21:26:12 +0000
commitd51ab20aaabbcc66c63dc43b603502e265e4882b (patch)
tree05f4fe3e46d6209fe1f6bf4a6832da69d591531f /Userland/Libraries
parente4b388ea5a96032060ca2907642da7e52eecd680 (diff)
downloadserenity-d51ab20aaabbcc66c63dc43b603502e265e4882b.zip
LibJS: Add spec comment to length_of_array_like()
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
index e759ef3c50..c31d39e7ab 100644
--- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
@@ -88,8 +88,8 @@ ThrowCompletionOr<Object*> construct_impl(VM& vm, FunctionObject& function, Opti
// 7.3.19 LengthOfArrayLike ( obj ), https://tc39.es/ecma262/#sec-lengthofarraylike
ThrowCompletionOr<size_t> length_of_array_like(VM& vm, Object const& object)
{
- auto result = TRY(object.get(vm.names.length));
- return result.to_length(vm);
+ // 1. Return ℝ(? ToLength(? Get(obj, "length"))).
+ return TRY(object.get(vm.names.length)).to_length(vm);
}
// 7.3.20 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike