OLD | NEW |
| (Empty) |
1 dart_library.library('syncstar_syntax', null, /* Imports */[ | |
2 'dart_sdk', | |
3 'expect' | |
4 ], function(exports, dart_sdk, expect) { | |
5 'use strict'; | |
6 const core = dart_sdk.core; | |
7 const dart = dart_sdk.dart; | |
8 const dartx = dart_sdk.dartx; | |
9 const expect$ = expect.expect; | |
10 const syncstar_syntax = Object.create(null); | |
11 syncstar_syntax.foo = function() { | |
12 return dart.syncStar(function*() { | |
13 yield 1; | |
14 yield* dart.list([2, 3], core.int); | |
15 }, core.int); | |
16 }; | |
17 dart.fn(syncstar_syntax.foo, core.Iterable$(core.int), []); | |
18 syncstar_syntax.Class = class Class extends core.Object { | |
19 bar() { | |
20 return dart.syncStar(function*() { | |
21 yield 1; | |
22 yield* dart.list([2, 3], core.int); | |
23 }, core.int); | |
24 } | |
25 static baz() { | |
26 return dart.syncStar(function*() { | |
27 yield 1; | |
28 yield* dart.list([2, 3], core.int); | |
29 }, core.int); | |
30 } | |
31 }; | |
32 dart.setSignature(syncstar_syntax.Class, { | |
33 methods: () => ({bar: [core.Iterable$(core.int), []]}), | |
34 statics: () => ({baz: [core.Iterable$(core.int), []]}), | |
35 names: ['baz'] | |
36 }); | |
37 syncstar_syntax.main = function() { | |
38 function qux() { | |
39 return dart.syncStar(function*() { | |
40 yield 1; | |
41 yield* dart.list([2, 3], core.int); | |
42 }, core.int); | |
43 } | |
44 dart.fn(qux, core.Iterable$(core.int), []); | |
45 expect$.Expect.listEquals(dart.list([1, 2, 3], core.int), syncstar_syntax.fo
o()[dartx.toList]()); | |
46 expect$.Expect.listEquals(dart.list([1, 2, 3], core.int), new syncstar_synta
x.Class().bar()[dartx.toList]()); | |
47 expect$.Expect.listEquals(dart.list([1, 2, 3], core.int), syncstar_syntax.Cl
ass.baz()[dartx.toList]()); | |
48 expect$.Expect.listEquals(dart.list([1, 2, 3], core.int), qux()[dartx.toList
]()); | |
49 }; | |
50 dart.fn(syncstar_syntax.main); | |
51 // Exports: | |
52 exports.syncstar_syntax = syncstar_syntax; | |
53 }); | |
OLD | NEW |