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

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

Issue 2119353002: [parser] Fix bug in for-of desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 5 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 | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/iterator-close.js
diff --git a/test/mjsunit/es6/iterator-close.js b/test/mjsunit/es6/iterator-close.js
index 1a96bee22323162b652108fa433775a538ad6e24..fd8f361e5e93978031589dc50e19b895ad721948 100644
--- a/test/mjsunit/es6/iterator-close.js
+++ b/test/mjsunit/es6/iterator-close.js
@@ -966,8 +966,9 @@ function* g() { yield 42; return 88 };
// Next method throws.
{
+ let closed = false;
g.prototype.next = () => { throw 666; };
- g.prototype.return = () => { assertUnreachable() };
+ g.prototype.return = () => { closed = true; };
assertThrowsEquals(() => {
@@ -1025,13 +1026,17 @@ function* g() { yield 42; return 88 };
assertThrowsEquals(() => {
(([...x]) => x)(g());
}, 666);
+
+
+ assertFalse(closed);
}
// Value throws.
{
+ let closed = false;
g.prototype.next = () => ({get value() {throw 666}});
- g.prototype.return = () => { assertUnreachable() };
+ g.prototype.return = () => { closed = true; };
assertThrowsEquals(() => {
@@ -1089,13 +1094,17 @@ function* g() { yield 42; return 88 };
assertThrowsEquals(() => {
(([...x]) => x)(g());
}, 666);
+
+
+ assertFalse(closed);
}
// Done throws.
{
+ let closed = false;
g.prototype.next = () => ({get done() {throw 666}});
- g.prototype.return = () => { assertUnreachable() };
+ g.prototype.return = () => { closed = true; };
assertThrowsEquals(() => {
@@ -1153,6 +1162,9 @@ function* g() { yield 42; return 88 };
assertThrowsEquals(() => {
(([...x]) => x)(g());
}, 666);
+
+
+ assertFalse(closed);
}
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698