lib: prefer AsyncIteratorPrototype primordial · nodejs/node@5b2363b

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -28,6 +28,7 @@ const {

2828

ArrayPrototypeSlice,

2929

ArrayPrototypeSplice,

3030

ArrayPrototypeUnshift,

31+

AsyncIteratorPrototype,

3132

Boolean,

3233

Error,

3334

ErrorCaptureStackTrace,

@@ -1000,9 +1001,6 @@ async function once(emitter, name, options = kEmptyObject) {

10001001

});

10011002

}

10021003
1003-

const AsyncIteratorPrototype = ObjectGetPrototypeOf(

1004-

ObjectGetPrototypeOf(async function* () {}).prototype);

1005-
10061004

function createIterResult(value, done) {

10071005

return { value, done };

10081006

}

Original file line numberDiff line numberDiff line change

@@ -31,6 +31,7 @@ const {

3131

ArrayPrototype,

3232

ArrayPrototypeForEach,

3333

ArrayPrototypePush,

34+

AsyncIteratorPrototype,

3435

Atomics,

3536

BigInt,

3637

BigInt64Array,

@@ -212,10 +213,7 @@ module.exports = function() {

212213

// 27 Control Abstraction Objects

213214

// 27.1 Iteration

214215

IteratorPrototype, // 27.1.2 IteratorPrototype

215-

// 27.1.3 AsyncIteratorPrototype

216-

ObjectGetPrototypeOf(ObjectGetPrototypeOf(ObjectGetPrototypeOf(

217-

(async function*() {})(),

218-

))),

216+

AsyncIteratorPrototype, // 27.1.3 AsyncIteratorPrototype

219217

PromisePrototype, // 27.2

220218
221219

// Other APIs / Web Compatibility