summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/WeakMap.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/builtin/WeakMap.js')
-rw-r--r--js/src/builtin/WeakMap.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/js/src/builtin/WeakMap.js b/js/src/builtin/WeakMap.js
index 066a72bfe..708be8424 100644
--- a/js/src/builtin/WeakMap.js
+++ b/js/src/builtin/WeakMap.js
@@ -40,10 +40,17 @@ function WeakMapConstructorInit(iterable) {
var nextItem = next.value;
// Step 8.d.
- if (!IsObject(nextItem))
+ if (!IsObject(nextItem)) {
+ IteratorCloseThrow(iter);
ThrowTypeError(JSMSG_INVALID_MAP_ITERABLE, "WeakMap");
+ }
// Steps 8.e-j.
- callContentFunction(adder, map, nextItem[0], nextItem[1]);
+ try {
+ callContentFunction(adder, map, nextItem[0], nextItem[1]);
+ } catch (e) {
+ IteratorCloseThrow(iter);
+ throw e;
+ }
}
}