From 948f85216a15e4ef489af21bb532a9b201b0364c Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 20 Dec 2022 11:37:50 +0900 Subject: chore: Update dlint (#17031) Introduces `SafeSetIterator` and `SafeMapIterator` to primordials --- core/00_primordials.js | 56 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 18 deletions(-) (limited to 'core/00_primordials.js') diff --git a/core/00_primordials.js b/core/00_primordials.js index d48dfde79..19e16860f 100644 --- a/core/00_primordials.js +++ b/core/00_primordials.js @@ -248,6 +248,24 @@ 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 @@ -259,6 +277,18 @@ prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()), }, }, + { + name: "SetIterator", + original: { + prototype: Reflect.getPrototypeOf(new Set()[Symbol.iterator]()), + }, + }, + { + name: "MapIterator", + original: { + prototype: Reflect.getPrototypeOf(new Map()[Symbol.iterator]()), + }, + }, { name: "StringIterator", original: { @@ -273,24 +303,6 @@ copyPrototype(original.prototype, primordials, `${name}Prototype`); }); - const { - ArrayPrototypeForEach, - ArrayPrototypeMap, - FunctionPrototypeCall, - Map, - ObjectDefineProperty, - ObjectFreeze, - ObjectPrototypeIsPrototypeOf, - ObjectSetPrototypeOf, - Promise, - PromisePrototype, - PromisePrototypeThen, - Set, - SymbolIterator, - WeakMap, - WeakSet, - } = 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: @@ -316,6 +328,14 @@ primordials.ArrayPrototypeSymbolIterator, primordials.ArrayIteratorPrototypeNext, ); + primordials.SafeSetIterator = createSafeIterator( + primordials.SetPrototypeSymbolIterator, + primordials.SetIteratorPrototypeNext, + ); + primordials.SafeMapIterator = createSafeIterator( + primordials.MapPrototypeSymbolIterator, + primordials.MapIteratorPrototypeNext, + ); primordials.SafeStringIterator = createSafeIterator( primordials.StringPrototypeSymbolIterator, primordials.StringIteratorPrototypeNext, -- cgit v1.2.3