summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Mansfield <jmansfield@cadixdev.org>2022-11-19 12:52:03 +0000
committerLinus Groh <mail@linusgroh.de>2022-11-19 14:23:28 +0000
commit24caacfe28fc9f07c96157c88d87fb08045c6080 (patch)
treedafcfb547f3a95d6d36879c783b8d5e7d5d3f5ef
parent67ed3e1d93d3daed829d83dc6b86a0af32264c5f (diff)
downloadserenity-24caacfe28fc9f07c96157c88d87fb08045c6080.zip
LibJS: Add spec comments to TypedArray.prototype.entries
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
index 5d64843988..6c31ba0ff2 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
@@ -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);
}