Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: test/mjsunit/harmony/iterator-close.js

Issue 1731773003: Ensure IteratorClose is called for errors in non-declaring assignments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase and fix test262 expectation Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/parsing/parser.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698