summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/WeakSet.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-15 21:11:35 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-15 21:11:35 +0100
commit75c9377766326589faa844a95d5997a156f6aed0 (patch)
treea2605876ee1a97a3a727d21a72b69c5a10a89664 /js/src/builtin/WeakSet.js
parent0d3ee51ad2d61bffba14232b2df913d3a773d771 (diff)
downloadUXP-75c9377766326589faa844a95d5997a156f6aed0.tar
UXP-75c9377766326589faa844a95d5997a156f6aed0.tar.gz
UXP-75c9377766326589faa844a95d5997a156f6aed0.tar.lz
UXP-75c9377766326589faa844a95d5997a156f6aed0.tar.xz
UXP-75c9377766326589faa844a95d5997a156f6aed0.zip
Close iterator after error in {Map,Set,WeakMap,WeakSet} constructors
Issue #17
Diffstat (limited to 'js/src/builtin/WeakSet.js')
-rw-r--r--js/src/builtin/WeakSet.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/src/builtin/WeakSet.js b/js/src/builtin/WeakSet.js
index eb7c2378f..8589f9dc6 100644
--- a/js/src/builtin/WeakSet.js
+++ b/js/src/builtin/WeakSet.js
@@ -40,7 +40,12 @@ function WeakSetConstructorInit(iterable) {
var nextValue = next.value;
// Steps 8.d-e.
- callContentFunction(adder, set, nextValue);
+ try {
+ callContentFunction(adder, set, nextValue);
+ } catch (e) {
+ IteratorCloseThrow(iter);
+ throw e;
+ }
}
}