Index: test/mjsunit/harmony/iterator-close.js |
diff --git a/test/mjsunit/harmony/iterator-close.js b/test/mjsunit/harmony/iterator-close.js |
index 3cc4412e8a967c3c18015af989ecb5ef14bd2e18..d3b7dc91684dad9a2ea0e2697b17c8dd6b2fb981 100644 |
--- a/test/mjsunit/harmony/iterator-close.js |
+++ b/test/mjsunit/harmony/iterator-close.js |
@@ -155,6 +155,13 @@ function* g() { yield 42; return 88 }; |
log = []; |
assertEquals(42, eval('for (x of g()) { x; }')); |
assertEquals([], log); |
+ |
+ // Even if doing the assignment throws, still call return |
+ x = { set attr(_) { throw 1234; } }; |
+ assertThrowsEquals(() => { |
+ for (x.attr of g()) { throw 456; } |
+ }, 1234); |
+ assertEquals([[]], log); |
} |