OLD | NEW |
1 library test; | 1 library test; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:async" as asy; | 4 import "dart:async" as asy; |
5 | 5 |
6 class MyFuture<T extends core::Object> extends core::Object implements asy::Futu
re<self::MyFuture::T> { | 6 class MyFuture<T extends core::Object> extends core::Object implements asy::Futu
re<self::MyFuture::T> { |
7 constructor •() → void | 7 constructor •() → void |
8 : super core::Object::•() {} | 8 : super core::Object::•() {} |
9 constructor value(dynamic x) → void | 9 constructor value(dynamic x) → void |
10 : super core::Object::•() {} | 10 : super core::Object::•() {} |
11 abstract method noSuchMethod(dynamic invocation) → dynamic; | 11 abstract method noSuchMethod(dynamic invocation) → dynamic; |
12 method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::
MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::My
Future::then::S> | 12 method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::
MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::My
Future::then::S> |
13 return null; | 13 return null; |
14 } | 14 } |
15 static method g1(core::bool x) → asy::Future<core::int> /* originally async */ { | 15 static method g1(core::bool x) → asy::Future<core::int> async { |
16 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::sy
nc<asy::FutureOr<core::int>>(); | 16 return x ? 42 : new self::MyFuture::value<core::int>(42); |
17 asy::FutureOr<core::int> :return_value; | |
18 dynamic :async_op_then; | |
19 dynamic :async_op_error; | |
20 dynamic :await_jump_var = 0; | |
21 dynamic :await_ctx_var; | |
22 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]
) → dynamic yielding | |
23 try { | |
24 #L1: | |
25 { | |
26 :return_value = x ? 42 : new self::MyFuture::value<core::int>(42); | |
27 break #L1; | |
28 } | |
29 :completer.complete(:return_value); | |
30 return; | |
31 } | |
32 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
33 :completer.completeError(:exception, :stack_trace); | |
34 } | |
35 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
36 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
37 asy::Future::microtask<dynamic>(:async_op); | |
38 return :completer.future; | |
39 } | 17 } |
40 static method g2(core::bool x) → asy::Future<core::int> /* originally async */ { | 18 static method g2(core::bool x) → asy::Future<core::int> async |
41 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::sy
nc<asy::FutureOr<core::int>>(); | 19 return x ? 42 : new self::MyFuture::value<core::int>(42); |
42 asy::FutureOr<core::int> :return_value; | 20 static method g3(core::bool x) → asy::Future<core::int> async { |
43 dynamic :async_op_then; | 21 core::Object y = x ? 42 : new self::MyFuture::value<dynamic>(42); |
44 dynamic :async_op_error; | 22 return y; |
45 dynamic :await_jump_var = 0; | |
46 dynamic :await_ctx_var; | |
47 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]
) → dynamic yielding | |
48 try { | |
49 #L2: | |
50 { | |
51 :return_value = x ? 42 : new self::MyFuture::value<core::int>(42); | |
52 break #L2; | |
53 } | |
54 :completer.complete(:return_value); | |
55 return; | |
56 } | |
57 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
58 :completer.completeError(:exception, :stack_trace); | |
59 } | |
60 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
61 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
62 asy::Future::microtask<dynamic>(:async_op); | |
63 return :completer.future; | |
64 } | |
65 static method g3(core::bool x) → asy::Future<core::int> /* originally async */ { | |
66 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::sy
nc<asy::FutureOr<core::int>>(); | |
67 asy::FutureOr<core::int> :return_value; | |
68 dynamic :async_op_then; | |
69 dynamic :async_op_error; | |
70 dynamic :await_jump_var = 0; | |
71 dynamic :await_ctx_var; | |
72 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]
) → dynamic yielding | |
73 try { | |
74 #L3: | |
75 { | |
76 core::Object y = x ? 42 : new self::MyFuture::value<dynamic>(42); | |
77 :return_value = y; | |
78 break #L3; | |
79 } | |
80 :completer.complete(:return_value); | |
81 return; | |
82 } | |
83 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
84 :completer.completeError(:exception, :stack_trace); | |
85 } | |
86 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
87 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
88 asy::Future::microtask<dynamic>(:async_op); | |
89 return :completer.future; | |
90 } | 23 } |
91 static method main() → dynamic {} | 24 static method main() → dynamic {} |
OLD | NEW |