summaryrefslogtreecommitdiff
path: root/core/00_primordials.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-04-26 07:36:22 +0900
committerGitHub <noreply@github.com>2023-04-26 00:36:22 +0200
commit9b49de46446f3acb3081bfa809652a8a66d54bfb (patch)
treed8ab2b27927928230d8a7d6ca9b06e6a16c2d068 /core/00_primordials.js
parent97820fe8abb15baabaf6b6eed632514867c7d97d (diff)
fix(core): Wrap safe collections' argument of primordials (#18750)
Diffstat (limited to 'core/00_primordials.js')
-rw-r--r--core/00_primordials.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/core/00_primordials.js b/core/00_primordials.js
index f49a11de4..60474e649 100644
--- a/core/00_primordials.js
+++ b/core/00_primordials.js
@@ -405,7 +405,11 @@
Map,
class SafeMap extends Map {
constructor(i) {
- super(i);
+ if (i == null) {
+ super();
+ return;
+ }
+ super(new SafeArrayIterator(i));
}
},
);
@@ -413,7 +417,11 @@
WeakMap,
class SafeWeakMap extends WeakMap {
constructor(i) {
- super(i);
+ if (i == null) {
+ super();
+ return;
+ }
+ super(new SafeArrayIterator(i));
}
},
);
@@ -422,7 +430,11 @@
Set,
class SafeSet extends Set {
constructor(i) {
- super(i);
+ if (i == null) {
+ super();
+ return;
+ }
+ super(new SafeArrayIterator(i));
}
},
);
@@ -430,7 +442,11 @@
WeakSet,
class SafeWeakSet extends WeakSet {
constructor(i) {
- super(i);
+ if (i == null) {
+ super();
+ return;
+ }
+ super(new SafeArrayIterator(i));
}
},
);