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

Unified Diff: test/codegen/expect/syncstar_yieldstar_test.js

Issue 1207313002: initial sync*, part of #221 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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/codegen/expect/syncstar_yield_test.txt ('k') | test/codegen/expect/syncstar_yieldstar_test.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/syncstar_yieldstar_test.js
diff --git a/test/codegen/expect/syncstar_yieldstar_test.js b/test/codegen/expect/syncstar_yieldstar_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..740c89af6993b1952b44292be24babae08468688
--- /dev/null
+++ b/test/codegen/expect/syncstar_yieldstar_test.js
@@ -0,0 +1,33 @@
+dart_library.library('syncstar_yieldstar_test', null, /* Imports */[
+ "dart_runtime/dart",
+ 'dart/core',
+ 'expect'
+], /* Lazy imports */[
+], function(exports, dart, core, expect) {
+ 'use strict';
+ let dartx = dart.dartx;
+ function* bar() {
+ let i = 1;
+ let j = 1;
+ while (true) {
+ yield i;
+ j = dart.notNull(i) + dart.notNull(j);
+ i = dart.notNull(j) - dart.notNull(i);
+ }
+ }
+ dart.fn(bar);
+ function* foo() {
+ yield* [1, 2, 3];
+ yield null;
+ yield* dart.as(bar(), core.Iterable);
+ }
+ dart.fn(foo);
+ function main() {
+ expect.Expect.listEquals([1, 2, 3, null, 1, 1, 2, 3, 5], dart.as(dart.dsend(dart.dsend(foo(), 'take', 9), 'toList'), core.List));
+ }
+ dart.fn(main);
+ // Exports:
+ exports.bar = bar;
+ exports.foo = foo;
+ exports.main = main;
+});
« no previous file with comments | « test/codegen/expect/syncstar_yield_test.txt ('k') | test/codegen/expect/syncstar_yieldstar_test.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698