RESOLVED FIXED 143140
IteratorClose should be called when jumping over the target for-of loop
https://bugs.webkit.org/show_bug.cgi?id=143140
Summary IteratorClose should be called when jumping over the target for-of loop
Yusuke Suzuki
Reported 2015-03-27 12:07:40 PDT
When executing the following script, var iter = ...; outer: for (var i of array) { for (var j of iter) { break outer; } } iter.return should be called.
Attachments
Patch (28.97 KB, patch)
2015-03-28 02:12 PDT, Yusuke Suzuki
no flags
Patch (24.70 KB, patch)
2015-03-28 02:27 PDT, Yusuke Suzuki
no flags
Patch (24.85 KB, patch)
2015-03-28 02:47 PDT, Yusuke Suzuki
no flags
Patch (26.24 KB, patch)
2015-03-30 10:39 PDT, Yusuke Suzuki
ggaren: review+
Yusuke Suzuki
Comment 1 2015-03-27 12:08:23 PDT
The patch is already submitted in https://bugs.webkit.org/show_bug.cgi?id=142575, I'll move it to here.
Yusuke Suzuki
Comment 2 2015-03-28 02:12:12 PDT
Yusuke Suzuki
Comment 3 2015-03-28 02:27:06 PDT
Yusuke Suzuki
Comment 4 2015-03-28 02:47:32 PDT
Yusuke Suzuki
Comment 5 2015-03-30 10:39:51 PDT
Geoffrey Garen
Comment 6 2015-03-31 16:55:57 PDT
Comment on attachment 249743 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=249743&action=review r=me > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2358 > + } else if (finallyContext.iterator) { This should be an else with an ASSERT. It shouldn't be possible to have a finally context without either a block of code or an iterator close.
Yusuke Suzuki
Comment 7 2015-04-01 02:35:28 PDT
Comment on attachment 249743 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=249743&action=review Thank you for your review! I'll fix and land it. >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2358 >> + } else if (finallyContext.iterator) { > > This should be an else with an ASSERT. It shouldn't be possible to have a finally context without either a block of code or an iterator close. You're right. Use else and ASSERT instead.
Yusuke Suzuki
Comment 8 2015-04-01 02:37:06 PDT
Note You need to log in before you can comment on or make changes to this bug.