OLD | NEW |
(Empty) | |
| 1 library test; |
| 2 import self as self; |
| 3 import "dart:core" as core; |
| 4 import "dart:async" as asy; |
| 5 |
| 6 typedef IntToInt = (core::int) → core::int; |
| 7 static method main() → dynamic { |
| 8 function a() → (core::int) → core::int { |
| 9 return (core::int x) → core::int => x; |
| 10 } |
| 11 function b() → asy::Future<(core::int) → core::int> /* originally async */ { |
| 12 final asy::Completer<asy::FutureOr<(core::int) → core::int>> :completer = as
y::Completer::sync<asy::FutureOr<(core::int) → core::int>>(); |
| 13 asy::FutureOr<(core::int) → core::int> :return_value; |
| 14 dynamic :async_op_then; |
| 15 dynamic :async_op_error; |
| 16 dynamic :await_jump_var = 0; |
| 17 dynamic :await_ctx_var; |
| 18 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding |
| 19 try { |
| 20 #L1: |
| 21 { |
| 22 :return_value = (dynamic x) → dynamic => x; |
| 23 break #L1; |
| 24 } |
| 25 :completer.complete(:return_value); |
| 26 return; |
| 27 } |
| 28 on dynamic catch(dynamic :exception, dynamic :stack_trace) { |
| 29 :completer.completeError(:exception, :stack_trace); |
| 30 } |
| 31 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| 32 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| 33 asy::Future::microtask<dynamic>(:async_op); |
| 34 return :completer.future; |
| 35 } |
| 36 function c() → core::Iterable<(core::int) → core::int> /* originally sync* */
{ |
| 37 dynamic :await_jump_var = 0; |
| 38 dynamic :await_ctx_var; |
| 39 function :sync_op(core::Iterator<dynamic> :iterator) → core::bool yielding { |
| 40 { |
| 41 { |
| 42 :iterator._current = (core::int x) → core::int => x; |
| 43 [yield] true; |
| 44 } |
| 45 } |
| 46 return false; |
| 47 } |
| 48 return new core::_SyncIterable::•(:sync_op); |
| 49 } |
| 50 function d() → core::Iterable<(core::int) → core::int> /* originally sync* */
{ |
| 51 dynamic :await_jump_var = 0; |
| 52 dynamic :await_ctx_var; |
| 53 function :sync_op(core::Iterator<dynamic> :iterator) → core::bool yielding { |
| 54 { |
| 55 { |
| 56 :iterator.isYieldEach = true; |
| 57 :iterator._current = <(core::int) → core::int>[(core::int x) → core::i
nt => x]; |
| 58 [yield] true; |
| 59 } |
| 60 } |
| 61 return false; |
| 62 } |
| 63 return new core::_SyncIterable::•(:sync_op); |
| 64 } |
| 65 function e() → asy::Stream<(core::int) → core::int> /* originally async* */ { |
| 66 dynamic :controller; |
| 67 dynamic :async_op_then; |
| 68 dynamic :async_op_error; |
| 69 dynamic :await_jump_var = 0; |
| 70 dynamic :await_ctx_var; |
| 71 dynamic :saved_try_context_var0; |
| 72 dynamic :saved_try_context_var1; |
| 73 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding |
| 74 try |
| 75 try { |
| 76 #L2: |
| 77 { |
| 78 if(:controller.add((core::int x) → core::int => x)) |
| 79 return null; |
| 80 else |
| 81 [yield] null; |
| 82 } |
| 83 return; |
| 84 } |
| 85 on dynamic catch(dynamic :exception, dynamic :stack_trace) { |
| 86 :controller.addError(:exception, :stack_trace); |
| 87 } |
| 88 finally { |
| 89 :controller.close(); |
| 90 } |
| 91 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| 92 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| 93 :controller = new asy::_AsyncStarStreamController::•(:async_op); |
| 94 return :controller.stream; |
| 95 } |
| 96 function f() → asy::Stream<(core::int) → core::int> /* originally async* */ { |
| 97 dynamic :controller; |
| 98 dynamic :async_op_then; |
| 99 dynamic :async_op_error; |
| 100 dynamic :await_jump_var = 0; |
| 101 dynamic :await_ctx_var; |
| 102 dynamic :saved_try_context_var0; |
| 103 dynamic :saved_try_context_var1; |
| 104 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding |
| 105 try |
| 106 try { |
| 107 #L3: |
| 108 { |
| 109 if(:controller.addStream(asy::Stream::fromIterable<(core::int) → cor
e::int>(<(core::int) → core::int>[(core::int x) → core::int => x]))) |
| 110 return null; |
| 111 else |
| 112 [yield] null; |
| 113 } |
| 114 return; |
| 115 } |
| 116 on dynamic catch(dynamic :exception, dynamic :stack_trace) { |
| 117 :controller.addError(:exception, :stack_trace); |
| 118 } |
| 119 finally { |
| 120 :controller.close(); |
| 121 } |
| 122 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| 123 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| 124 :controller = new asy::_AsyncStarStreamController::•(:async_op); |
| 125 return :controller.stream; |
| 126 } |
| 127 } |
OLD | NEW |