| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| import "dart:_internal" as _in; |
| |
| import "dart:async"; |
| |
| class C extends core::Object { |
| synthetic constructor •() → self::C |
| : super core::Object::•() |
| ; |
| method m() → asy::Future<core::List<core::int>> /* originally async */ { |
| final asy::_Future<core::List<core::int>> :async_future = new asy::_Future::•<core::List<core::int>>(); |
| core::bool* :is_sync = false; |
| core::List<core::int>? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (core::Object, core::StackTrace) → dynamic :async_op_error; |
| core::int :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| dynamic :saved_try_context_var0; |
| function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding |
| try { |
| #L1: |
| { |
| final core::List<core::int> #t1 = core::_GrowableList::•<core::int>(0); |
| [yield] let dynamic #t2 = asy::_awaitHelper(this.{self::C::_m}(){() → asy::Future<core::int>}, :async_op_then, :async_op_error) in null; |
| #t1.{core::List::add}(_in::unsafeCast<core::int>(:result_or_exception)){(core::int) → void}; |
| :return_value = block {} =>#t1; |
| break #L1; |
| } |
| asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op(null, null){() → dynamic}; |
| :is_sync = true; |
| return :async_future; |
| } |
| method _m() → asy::Future<core::int> /* originally async */ { |
| final asy::_Future<core::int> :async_future = new asy::_Future::•<core::int>(); |
| core::bool* :is_sync = false; |
| core::int? :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (core::Object, core::StackTrace) → dynamic :async_op_error; |
| core::int :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding |
| try { |
| #L2: |
| { |
| :return_value = 42; |
| break #L2; |
| } |
| asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op(null, null){() → dynamic}; |
| :is_sync = true; |
| return :async_future; |
| } |
| } |
| static method main() → dynamic /* originally async */ { |
| final asy::_Future<dynamic> :async_future = new asy::_Future::•<dynamic>(); |
| core::bool* :is_sync = false; |
| dynamic :return_value; |
| (dynamic) → dynamic :async_op_then; |
| (core::Object, core::StackTrace) → dynamic :async_op_error; |
| core::int :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| dynamic :saved_try_context_var0; |
| function :async_op(dynamic :result_or_exception, dynamic :stack_trace) → dynamic yielding |
| try { |
| #L3: |
| { |
| [yield] let dynamic #t3 = asy::_awaitHelper(new self::C::•().{self::C::m}(){() → asy::Future<core::List<core::int>>}, :async_op_then, :async_op_error) in null; |
| self::expect(42, _in::unsafeCast<core::List<core::int>>(:result_or_exception).{core::Iterable::first}{core::int}); |
| } |
| asy::_completeWithNoFutureOnAsyncReturn(:async_future, :return_value, :is_sync); |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace stack_trace) { |
| asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync); |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_op(null, null){() → dynamic}; |
| :is_sync = true; |
| return :async_future; |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |