lib: prefer AsyncIteratorPrototype primordial

PR-URL: https://github.com/nodejs/node/pull/59097
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
René 2025-07-29 22:54:16 +01:00 committed by GitHub
parent cd0c5159e6
commit eabb75cea8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View file

@ -28,6 +28,7 @@ const {
ArrayPrototypeSlice, ArrayPrototypeSlice,
ArrayPrototypeSplice, ArrayPrototypeSplice,
ArrayPrototypeUnshift, ArrayPrototypeUnshift,
AsyncIteratorPrototype,
Boolean, Boolean,
Error, Error,
ErrorCaptureStackTrace, ErrorCaptureStackTrace,
@ -1000,9 +1001,6 @@ async function once(emitter, name, options = kEmptyObject) {
}); });
} }
const AsyncIteratorPrototype = ObjectGetPrototypeOf(
ObjectGetPrototypeOf(async function* () {}).prototype);
function createIterResult(value, done) { function createIterResult(value, done) {
return { value, done }; return { value, done };
} }

View file

@ -31,6 +31,7 @@ const {
ArrayPrototype, ArrayPrototype,
ArrayPrototypeForEach, ArrayPrototypeForEach,
ArrayPrototypePush, ArrayPrototypePush,
AsyncIteratorPrototype,
Atomics, Atomics,
BigInt, BigInt,
BigInt64Array, BigInt64Array,
@ -212,10 +213,7 @@ module.exports = function() {
// 27 Control Abstraction Objects // 27 Control Abstraction Objects
// 27.1 Iteration // 27.1 Iteration
IteratorPrototype, // 27.1.2 IteratorPrototype IteratorPrototype, // 27.1.2 IteratorPrototype
// 27.1.3 AsyncIteratorPrototype AsyncIteratorPrototype, // 27.1.3 AsyncIteratorPrototype
ObjectGetPrototypeOf(ObjectGetPrototypeOf(ObjectGetPrototypeOf(
(async function*() {})(),
))),
PromisePrototype, // 27.2 PromisePrototype, // 27.2
// Other APIs / Web Compatibility // Other APIs / Web Compatibility