summaryrefslogtreecommitdiff
path: root/core/00_primordials.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2022-12-20 11:37:50 +0900
committerGitHub <noreply@github.com>2022-12-20 03:37:50 +0100
commit948f85216a15e4ef489af21bb532a9b201b0364c (patch)
tree35c2bbfa021cf9a4190ab803ed091c5547bfe9f4 /core/00_primordials.js
parent2ac575abfb75dc4533306c80240cb1beeb816b9b (diff)
chore: Update dlint (#17031)
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
Diffstat (limited to 'core/00_primordials.js')
-rw-r--r--core/00_primordials.js56
1 files changed, 38 insertions, 18 deletions
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
@@ -260,6 +278,18 @@
},
},
{
+ name: "SetIterator",
+ original: {
+ prototype: Reflect.getPrototypeOf(new Set()[Symbol.iterator]()),
+ },
+ },
+ {
+ name: "MapIterator",
+ original: {
+ prototype: Reflect.getPrototypeOf(new Map()[Symbol.iterator]()),
+ },
+ },
+ {
name: "StringIterator",
original: {
prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()),
@@ -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,