OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/await_not_started_immediately_test', null, /* Imp
orts */[ |
| 2 'dart_sdk', |
| 3 'async_helper', |
| 4 'expect' |
| 5 ], function load__await_not_started_immediately_test(exports, dart_sdk, async_he
lper, expect) { |
| 6 'use strict'; |
| 7 const core = dart_sdk.core; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const async_helper$ = async_helper.async_helper; |
| 11 const expect$ = expect.expect; |
| 12 const await_not_started_immediately_test = Object.create(null); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionT
ype(dart.void, [dart.dynamic])))(); |
| 15 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 16 await_not_started_immediately_test.x = 0; |
| 17 await_not_started_immediately_test.foo = function() { |
| 18 return dart.async(function*() { |
| 19 await_not_started_immediately_test.x = dart.notNull(await_not_started_imme
diately_test.x) + 1; |
| 20 yield 1; |
| 21 await_not_started_immediately_test.x = dart.notNull(await_not_started_imme
diately_test.x) + 1; |
| 22 }, dart.dynamic); |
| 23 }; |
| 24 dart.fn(await_not_started_immediately_test.foo, VoidTodynamic()); |
| 25 await_not_started_immediately_test.main = function() { |
| 26 async_helper$.asyncStart(); |
| 27 dart.dsend(dart.dsend(await_not_started_immediately_test.foo(), 'then', dart
.fn(_ => expect$.Expect.equals(2, await_not_started_immediately_test.x), dynamic
Tovoid())), 'whenComplete', async_helper$.asyncEnd); |
| 28 expect$.Expect.equals(0, await_not_started_immediately_test.x); |
| 29 }; |
| 30 dart.fn(await_not_started_immediately_test.main, VoidTovoid()); |
| 31 // Exports: |
| 32 exports.await_not_started_immediately_test = await_not_started_immediately_tes
t; |
| 33 }); |
OLD | NEW |