From d51ab20aaabbcc66c63dc43b603502e265e4882b Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 12 Dec 2022 21:16:54 +0000 Subject: [PATCH] LibJS: Add spec comment to length_of_array_like() --- Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp | 4 ++-- 1 file 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 construct_impl(VM& vm, FunctionObject& function, Opti // 7.3.19 LengthOfArrayLike ( obj ), https://tc39.es/ecma262/#sec-lengthofarraylike ThrowCompletionOr 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