mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
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:
parent
cd0c5159e6
commit
eabb75cea8
2 changed files with 3 additions and 7 deletions
|
@ -28,6 +28,7 @@ const {
|
|||
ArrayPrototypeSlice,
|
||||
ArrayPrototypeSplice,
|
||||
ArrayPrototypeUnshift,
|
||||
AsyncIteratorPrototype,
|
||||
Boolean,
|
||||
Error,
|
||||
ErrorCaptureStackTrace,
|
||||
|
@ -1000,9 +1001,6 @@ async function once(emitter, name, options = kEmptyObject) {
|
|||
});
|
||||
}
|
||||
|
||||
const AsyncIteratorPrototype = ObjectGetPrototypeOf(
|
||||
ObjectGetPrototypeOf(async function* () {}).prototype);
|
||||
|
||||
function createIterResult(value, done) {
|
||||
return { value, done };
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ const {
|
|||
ArrayPrototype,
|
||||
ArrayPrototypeForEach,
|
||||
ArrayPrototypePush,
|
||||
AsyncIteratorPrototype,
|
||||
Atomics,
|
||||
BigInt,
|
||||
BigInt64Array,
|
||||
|
@ -212,10 +213,7 @@ module.exports = function() {
|
|||
// 27 Control Abstraction Objects
|
||||
// 27.1 Iteration
|
||||
IteratorPrototype, // 27.1.2 IteratorPrototype
|
||||
// 27.1.3 AsyncIteratorPrototype
|
||||
ObjectGetPrototypeOf(ObjectGetPrototypeOf(ObjectGetPrototypeOf(
|
||||
(async function*() {})(),
|
||||
))),
|
||||
AsyncIteratorPrototype, // 27.1.3 AsyncIteratorPrototype
|
||||
PromisePrototype, // 27.2
|
||||
|
||||
// Other APIs / Web Compatibility
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue