diff --git a/lib/events.js b/lib/events.js index 5bfe95c84ab198..d3db675e585c95 100644 --- a/lib/events.js +++ b/lib/events.js @@ -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 }; } diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index ac7723b528e872..1d793d719f5fbf 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -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