LibJS: Add spec comment to length_of_array_like()

This commit is contained in:
Linus Groh 2022-12-12 21:16:54 +00:00
parent e4b388ea5a
commit d51ab20aaa

View file

@ -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