1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibJS: Add spec comments to TypedArray.prototype.entries

This commit is contained in:
Jamie Mansfield 2022-11-19 12:52:03 +00:00 committed by Linus Groh
parent 67ed3e1d93
commit 24caacfe28

View file

@ -387,7 +387,11 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::entries)
{
auto& realm = *vm.current_realm();
// 1. Let O be the this value.
// 2. Perform ? ValidateTypedArray(O).
auto* typed_array = TRY(validate_typed_array_from_this(vm));
// 3. Return CreateArrayIterator(O, key+value).
return ArrayIterator::create(realm, typed_array, Object::PropertyKind::KeyAndValue);
}