summaryrefslogtreecommitdiffstats
path: root/js/src/vm/Interpreter.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-25 14:48:34 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-25 14:48:34 +0200
commite7a220aae2dd6f92c57b92fdd08ff94e5826c035 (patch)
tree3f26d96607aaa80bcafe946f994d332e8e7cb0c5 /js/src/vm/Interpreter.cpp
parent6056525ced07af6c6c4f48ea605a2f4589821fdf (diff)
downloadUXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar
UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar.gz
UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar.lz
UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar.xz
UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.zip
Bug 1331585 - Allow falsy "done" values for IteratorClose due to exception during array destructuring
Issue #74
Diffstat (limited to 'js/src/vm/Interpreter.cpp')
-rw-r--r--js/src/vm/Interpreter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
index 9a8c6777f..7f8ff8445 100644
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1205,8 +1205,9 @@ ProcessTryNotes(JSContext* cx, EnvironmentIter& ei, InterpreterRegs& regs)
// stack. The iterator object is second from the top.
MOZ_ASSERT(tn->stackDepth > 1);
Value* sp = regs.spForStackDepth(tn->stackDepth);
- MOZ_ASSERT(sp[-1].isBoolean());
- if (sp[-1].isFalse()) {
+ RootedValue doneValue(cx, sp[-1]);
+ bool done = ToBoolean(doneValue);
+ if (!done) {
RootedObject iterObject(cx, &sp[-2].toObject());
if (!IteratorCloseForException(cx, iterObject)) {
SettleOnTryNote(cx, tn, ei, regs);