OLD | NEW |
| (Empty) |
1 dart_library.library('syncstar_yieldstar_test', null, /* Imports */[ | |
2 "dart_runtime/dart", | |
3 'dart/core', | |
4 'expect' | |
5 ], /* Lazy imports */[ | |
6 ], function(exports, dart, core, expect) { | |
7 'use strict'; | |
8 let dartx = dart.dartx; | |
9 function* bar() { | |
10 let i = 1; | |
11 let j = 1; | |
12 while (true) { | |
13 yield i; | |
14 j = dart.notNull(i) + dart.notNull(j); | |
15 i = dart.notNull(j) - dart.notNull(i); | |
16 } | |
17 } | |
18 dart.fn(bar); | |
19 function* foo() { | |
20 yield* [1, 2, 3]; | |
21 yield null; | |
22 yield* dart.as(bar(), core.Iterable); | |
23 } | |
24 dart.fn(foo); | |
25 function main() { | |
26 expect.Expect.listEquals([1, 2, 3, null, 1, 1, 2, 3, 5], dart.as(dart.dsend(
dart.dsend(foo(), 'take', 9), 'toList'), core.List)); | |
27 } | |
28 dart.fn(main); | |
29 // Exports: | |
30 exports.bar = bar; | |
31 exports.foo = foo; | |
32 exports.main = main; | |
33 }); | |
OLD | NEW |