| library test; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| |
| static method test() → dynamic { |
| function f0() → core::int* |
| return 42; |
| function f1() → asy::Future<core::int*>* /* originally async */ { |
| final asy::_Future<core::int*>* :async_future = new asy::_Future::•<core::int*>(); |
| core::bool* :is_sync = false; |
| FutureOr<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, dynamic :exception, dynamic :stack_trace]) → dynamic yielding |
| try { |
| #L1: |
| { |
| :return_value = 42; |
| break #L1; |
| } |
| asy::_completeOnAsyncReturn(: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(){() →* dynamic}; |
| :is_sync = true; |
| return :async_future; |
| } |
| function f2() → core::int* { |
| return 42; |
| } |
| function f3() → asy::Future<core::int*>* /* originally async */ { |
| final asy::_Future<core::int*>* :async_future = new asy::_Future::•<core::int*>(); |
| core::bool* :is_sync = false; |
| FutureOr<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, dynamic :exception, dynamic :stack_trace]) → dynamic yielding |
| try { |
| #L2: |
| { |
| :return_value = 42; |
| break #L2; |
| } |
| asy::_completeOnAsyncReturn(: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(){() →* dynamic}; |
| :is_sync = true; |
| return :async_future; |
| } |
| function f4() → core::Iterable<core::int*>* /* originally sync* */ { |
| function :sync_op_gen() → (core::_SyncIterator<dynamic>*, dynamic, dynamic) →* core::bool* { |
| core::int* :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| function :sync_op(core::_SyncIterator<dynamic>* :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding { |
| { |
| { |
| :iterator.{core::_SyncIterator::_current} = 42; |
| [yield] true; |
| } |
| } |
| return false; |
| } |
| return :sync_op; |
| } |
| return new core::_SyncIterable::•<core::int*>(:sync_op_gen); |
| } |
| function f5() → asy::Stream<core::int*>* /* originally async* */ { |
| asy::_AsyncStarStreamController<core::int*>* :controller; |
| dynamic :controller_stream; |
| (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; |
| dynamic :saved_try_context_var1; |
| function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding |
| try |
| try { |
| #L3: |
| { |
| if(:controller.{asy::_AsyncStarStreamController::add}(42){(core::int*) → core::bool}) |
| return null; |
| else |
| [yield] null; |
| } |
| return; |
| } |
| on dynamic catch(dynamic exception, core::StackTrace* stack_trace) { |
| :controller.{asy::_AsyncStarStreamController::addError}(exception, stack_trace){(core::Object, core::StackTrace) → void}; |
| } |
| finally { |
| :controller.{asy::_AsyncStarStreamController::close}(){() → dynamic}; |
| } |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :controller = new asy::_AsyncStarStreamController::•<core::int*>(:async_op); |
| :controller_stream = :controller.{asy::_AsyncStarStreamController::stream}{asy::Stream<core::int*>}; |
| return :controller_stream; |
| } |
| function f6() → core::num* |
| return 42; |
| function f7() → dynamic |
| return f7(){() →* dynamic}; |
| function f8() → asy::Stream<core::int*>* |
| return f5(){() →* asy::Stream<core::int*>*}; |
| () →* core::int* v0 = f0; |
| () →* asy::Future<core::int*>* v1 = f1; |
| () →* core::int* v2 = f2; |
| () →* asy::Future<core::int*>* v3 = f3; |
| () →* core::Iterable<core::int*>* v4 = f4; |
| () →* asy::Stream<core::int*>* v5 = f5; |
| () →* core::num* v6 = f6; |
| () →* dynamic v7 = f7; |
| () →* asy::Stream<core::int*>* v8 = f8; |
| } |
| static method main() → dynamic {} |