OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/async_await_catch_regression_test', null, /* Impo
rts */[ |
| 2 'dart_sdk', |
| 3 'expect', |
| 4 'async_helper' |
| 5 ], function load__async_await_catch_regression_test(exports, dart_sdk, expect, a
sync_helper) { |
| 6 'use strict'; |
| 7 const core = dart_sdk.core; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const async_helper$ = async_helper.async_helper; |
| 12 const async_await_catch_regression_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 async_await_catch_regression_test.foo = function() { |
| 16 return dart.async(function*() { |
| 17 dart.throw(42); |
| 18 }, dart.dynamic); |
| 19 }; |
| 20 dart.fn(async_await_catch_regression_test.foo, VoidTodynamic()); |
| 21 async_await_catch_regression_test.test = function() { |
| 22 return dart.async(function*() { |
| 23 let exception = null; |
| 24 try { |
| 25 yield async_await_catch_regression_test.foo(); |
| 26 } catch (e) { |
| 27 core.print(yield e); |
| 28 yield exception = (yield e); |
| 29 } |
| 30 |
| 31 expect$.Expect.equals(42, exception); |
| 32 }, dart.dynamic); |
| 33 }; |
| 34 dart.fn(async_await_catch_regression_test.test, VoidTodynamic()); |
| 35 async_await_catch_regression_test.main = function() { |
| 36 async_helper$.asyncStart(); |
| 37 dart.dsend(async_await_catch_regression_test.test(), 'then', dart.fn(_ => as
ync_helper$.asyncEnd(), dynamicTovoid())); |
| 38 }; |
| 39 dart.fn(async_await_catch_regression_test.main, VoidTodynamic()); |
| 40 // Exports: |
| 41 exports.async_await_catch_regression_test = async_await_catch_regression_test; |
| 42 }); |
OLD | NEW |