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,
|
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 };
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue