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

Unified Diff: test/mjsunit/harmony/function-sent.js

Issue 1639343005: [generators] Implement Generator.prototype.return. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@yield-star
Patch Set: Another rebase 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 | « test/mjsunit/es6/generators-runtime.js ('k') | test/mjsunit/harmony/generators.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/function-sent.js
diff --git a/test/mjsunit/harmony/function-sent.js b/test/mjsunit/harmony/function-sent.js
index 9dbc16882ee5129ca0e34f1988cf5e5ac0378e3d..b3cd644dd9ce43da06b58c65dca66faaef58824e 100644
--- a/test/mjsunit/harmony/function-sent.js
+++ b/test/mjsunit/harmony/function-sent.js
@@ -22,18 +22,25 @@
}
{
- x = g();
+ let x = g();
assertEquals({value: 1, done: false}, x.next(1));
assertEquals({value: 2, done: false}, x.next(2));
assertEquals({value: 3, done: true}, x.next(3));
}
{
- x = g();
+ let x = g();
assertEquals({value: 1, done: false}, x.next(1));
assertEquals({value: 2, done: false}, x.throw(2));
assertEquals({value: 3, done: true}, x.next(3));
}
+
+ {
+ let x = g();
+ assertEquals({value: 1, done: false}, x.next(1));
+ assertEquals({value: 2, done: false}, x.return(2));
+ assertEquals({value: 3, done: true}, x.next(3));
+ }
}
@@ -53,18 +60,25 @@
}
{
- x = g();
+ let x = g();
assertEquals({value: 1, done: false}, x.next(1));
assertEquals({value: undefined, done: false}, x.next(2));
assertEquals({value: 3, done: true}, x.next(3));
}
{
- x = g();
+ let x = g();
assertEquals({value: 1, done: false}, x.next(1));
assertEquals({value: undefined, done: false}, x.next(2));
assertEquals({value: 42, done: true}, x.throw(42));
}
+
+ {
+ let x = g();
+ assertEquals({value: 1, done: false}, x.next(1));
+ assertEquals({value: undefined, done: false}, x.next(2));
+ assertEquals({value: 42, done: true}, x.return(42));
+ }
}
« no previous file with comments | « test/mjsunit/es6/generators-runtime.js ('k') | test/mjsunit/harmony/generators.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698