OLD | NEW |
1 dart_library.library('language/async_star_test_05_multi', null, /* Imports */[ | 1 dart_library.library('language/async_star_test_05_multi', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'unittest' | 3 'unittest' |
4 ], function load__async_star_test_05_multi(exports, dart_sdk, unittest) { | 4 ], function load__async_star_test_05_multi(exports, dart_sdk, unittest) { |
5 'use strict'; | 5 'use strict'; |
6 const core = dart_sdk.core; | 6 const core = dart_sdk.core; |
7 const _interceptors = dart_sdk._interceptors; | 7 const _interceptors = dart_sdk._interceptors; |
8 const async = dart_sdk.async; | 8 const async = dart_sdk.async; |
9 const dart = dart_sdk.dart; | 9 const dart = dart_sdk.dart; |
10 const dartx = dart_sdk.dartx; | 10 const dartx = dart_sdk.dartx; |
11 const unittest$ = unittest.unittest; | 11 const unittest$ = unittest.unittest; |
12 const src__matcher__expect = unittest.src__matcher__expect; | 12 const src__matcher__expect = unittest.src__matcher__expect; |
13 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; | 13 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; |
14 const src__matcher__numeric_matchers = unittest.src__matcher__numeric_matchers
; | 14 const src__matcher__numeric_matchers = unittest.src__matcher__numeric_matchers
; |
15 const async_star_test_05_multi = Object.create(null); | 15 const async_star_test_05_multi = Object.create(null); |
16 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); | 16 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
17 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr
ray$(core.Object)))(); | 17 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr
ray$(core.Object)))(); |
| 18 let StreamOfint = () => (StreamOfint = dart.constFn(async.Stream$(core.int)))(
); |
18 let FutureOfObject = () => (FutureOfObject = dart.constFn(async.Future$(core.O
bject)))(); | 19 let FutureOfObject = () => (FutureOfObject = dart.constFn(async.Future$(core.O
bject)))(); |
19 let StreamOfObject = () => (StreamOfObject = dart.constFn(async.Stream$(core.O
bject)))(); | 20 let StreamOfObject = () => (StreamOfObject = dart.constFn(async.Stream$(core.O
bject)))(); |
20 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr
ray$(core.String)))(); | 21 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr
ray$(core.String)))(); |
21 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); | 22 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
22 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); | 23 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
23 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionT
ype(dart.void, [dart.dynamic])))(); | 24 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionT
ype(dart.void, [dart.dynamic])))(); |
24 let VoidToFuture = () => (VoidToFuture = dart.constFn(dart.definiteFunctionTyp
e(async.Future, [])))(); | 25 let VoidToFuture = () => (VoidToFuture = dart.constFn(dart.definiteFunctionTyp
e(async.Future, [])))(); |
25 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); | 26 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
26 let VoidToObject = () => (VoidToObject = dart.constFn(dart.definiteFunctionTyp
e(core.Object, [])))(); | 27 let VoidToObject = () => (VoidToObject = dart.constFn(dart.definiteFunctionTyp
e(core.Object, [])))(); |
27 let VoidToFutureOfObject = () => (VoidToFutureOfObject = dart.constFn(dart.def
initeFunctionType(FutureOfObject(), [])))(); | 28 let VoidToFutureOfObject = () => (VoidToFutureOfObject = dart.constFn(dart.def
initeFunctionType(FutureOfObject(), [])))(); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 yield; | 122 yield; |
122 } | 123 } |
123 }, dart.dynamic); | 124 }, dart.dynamic); |
124 } | 125 } |
125 dart.fn(f, VoidTodynamic()); | 126 dart.fn(f, VoidTodynamic()); |
126 return async_star_test_05_multi.expectList(f(), core.List.generate(10, a
sync_star_test_05_multi.id)); | 127 return async_star_test_05_multi.expectList(f(), core.List.generate(10, a
sync_star_test_05_multi.id)); |
127 }, VoidTodynamic())); | 128 }, VoidTodynamic())); |
128 unittest$.test("allows yield*", dart.fn(() => { | 129 unittest$.test("allows yield*", dart.fn(() => { |
129 function f() { | 130 function f() { |
130 return dart.asyncStar(function*(stream) { | 131 return dart.asyncStar(function*(stream) { |
131 if (stream.addStream(async.Stream.fromIterable(JSArrayOfint().of([1,
2, 3])))) return; | 132 if (stream.addStream(StreamOfint().fromIterable(JSArrayOfint().of([1
, 2, 3])))) return; |
132 yield; | 133 yield; |
133 }, dart.dynamic); | 134 }, dart.dynamic); |
134 } | 135 } |
135 dart.fn(f, VoidTodynamic()); | 136 dart.fn(f, VoidTodynamic()); |
136 return async_star_test_05_multi.expectList(f(), JSArrayOfint().of([1, 2,
3])); | 137 return async_star_test_05_multi.expectList(f(), JSArrayOfint().of([1, 2,
3])); |
137 }, VoidTodynamic())); | 138 }, VoidTodynamic())); |
138 unittest$.test("allows yield* of async*", dart.fn(() => { | 139 unittest$.test("allows yield* of async*", dart.fn(() => { |
139 function f(n) { | 140 function f(n) { |
140 return dart.asyncStar(function*(stream, n) { | 141 return dart.asyncStar(function*(stream, n) { |
141 if (stream.add(n)) return; | 142 if (stream.add(n)) return; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 yield; | 252 yield; |
252 } | 253 } |
253 }, dart.dynamic); | 254 }, dart.dynamic); |
254 } | 255 } |
255 dart.fn(f, VoidTodynamic()); | 256 dart.fn(f, VoidTodynamic()); |
256 return async_star_test_05_multi.expectList(f(), JSArrayOfint().of([0, 1,
2])); | 257 return async_star_test_05_multi.expectList(f(), JSArrayOfint().of([0, 1,
2])); |
257 }, VoidTodynamic())); | 258 }, VoidTodynamic())); |
258 unittest$.test("await for-in-loop", dart.fn(() => { | 259 unittest$.test("await for-in-loop", dart.fn(() => { |
259 function f() { | 260 function f() { |
260 return dart.asyncStar(function*(stream) { | 261 return dart.asyncStar(function*(stream) { |
261 let it = async.StreamIterator.new(async.Stream.fromIterable(JSArrayO
fint().of([0, 1, 2]))); | 262 let it = async.StreamIterator.new(StreamOfint().fromIterable(JSArray
Ofint().of([0, 1, 2]))); |
262 try { | 263 try { |
263 while (yield it.moveNext()) { | 264 while (yield it.moveNext()) { |
264 let i = it.current; | 265 let i = it.current; |
265 if (stream.add(i)) return; | 266 if (stream.add(i)) return; |
266 yield; | 267 yield; |
267 } | 268 } |
268 } finally { | 269 } finally { |
269 yield it.cancel(); | 270 yield it.cancel(); |
270 } | 271 } |
271 }, dart.dynamic); | 272 }, dart.dynamic); |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 }; | 1167 }; |
1167 dart.setSignature(async_star_test_05_multi.Sync, { | 1168 dart.setSignature(async_star_test_05_multi.Sync, { |
1168 methods: () => ({ | 1169 methods: () => ({ |
1169 wait: dart.definiteFunctionType(async.Future, [], [dart.dynamic]), | 1170 wait: dart.definiteFunctionType(async.Future, [], [dart.dynamic]), |
1170 release: dart.definiteFunctionType(dart.void, [], [dart.dynamic]) | 1171 release: dart.definiteFunctionType(dart.void, [], [dart.dynamic]) |
1171 }) | 1172 }) |
1172 }); | 1173 }); |
1173 // Exports: | 1174 // Exports: |
1174 exports.async_star_test_05_multi = async_star_test_05_multi; | 1175 exports.async_star_test_05_multi = async_star_test_05_multi; |
1175 }); | 1176 }); |
OLD | NEW |