diff options
Diffstat (limited to 'core/00_primordials.js')
-rw-r--r-- | core/00_primordials.js | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/core/00_primordials.js b/core/00_primordials.js index 33d7299d5..d394d1294 100644 --- a/core/00_primordials.js +++ b/core/00_primordials.js @@ -248,24 +248,6 @@ copyPrototype(original.prototype, primordials, `${name}Prototype`); }); - const { - ArrayPrototypeForEach, - ArrayPrototypeMap, - FunctionPrototypeCall, - Map, - ObjectDefineProperty, - ObjectFreeze, - ObjectPrototypeIsPrototypeOf, - ObjectSetPrototypeOf, - Promise, - PromisePrototype, - PromisePrototypeThen, - Set, - SymbolIterator, - WeakMap, - WeakSet, - } = primordials; - // Create copies of abstract intrinsic objects that are not directly exposed // on the global object. // Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object @@ -295,6 +277,11 @@ prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()), }, }, + { name: "Generator", original: Reflect.getPrototypeOf(function* () {}) }, + { + name: "AsyncGenerator", + original: Reflect.getPrototypeOf(async function* () {}), + }, ].forEach(({ name, original }) => { primordials[name] = original; // The static %TypedArray% methods require a valid `this`, but can't be bound, @@ -303,6 +290,20 @@ copyPrototype(original.prototype, primordials, `${name}Prototype`); }); + const { + ArrayPrototypeForEach, + ArrayPrototypeMap, + FunctionPrototypeCall, + ObjectDefineProperty, + ObjectFreeze, + ObjectPrototypeIsPrototypeOf, + ObjectSetPrototypeOf, + Promise, + PromisePrototype, + PromisePrototypeThen, + SymbolIterator, + } = primordials; + // Because these functions are used by `makeSafe`, which is exposed // on the `primordials` object, it's important to use const references // to the primordials that they use: |