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

Unified Diff: test/mjsunit/harmony/generators.js

Issue 1901713003: [generators] Perform state dispatch in loop header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 8 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/harmony/generators.js
diff --git a/test/mjsunit/harmony/generators.js b/test/mjsunit/harmony/generators.js
index 74bd4876066f3aac6443caecd6af283b6678db35..c9b59bc53a2f2e52b2a0017b5597aca79387c050 100644
--- a/test/mjsunit/harmony/generators.js
+++ b/test/mjsunit/harmony/generators.js
@@ -575,3 +575,26 @@
}
assertEquals({value: undefined, done: true}, g.next());
}
+
+{
+ function* foo() {
+ for (let i = 0; i < 3; ++i) {
+ let j = 0
+ yield i;
+ do {
+ yield (i + 10);
+ } while (++j < 2);
+ }
+ }
+ g = foo();
+ assertEquals({value: 0, done: false}, g.next());
+ assertEquals({value: 10, done: false}, g.next());
+ assertEquals({value: 10, done: false}, g.next());
+ assertEquals({value: 1, done: false}, g.next());
+ assertEquals({value: 11, done: false}, g.next());
+ assertEquals({value: 11, done: false}, g.next());
+ assertEquals({value: 2, done: false}, g.next());
+ assertEquals({value: 12, done: false}, g.next());
+ assertEquals({value: 12, done: false}, g.next());
+ assertEquals({value: undefined, done: true}, g.next());
+}
« 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