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(self::MyFuture::T x) → void | 9 constructor value(self::MyFuture::T 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 test() → void { | 15 static method test() → void { |
16 asy::Future<dynamic> f; | 16 asy::Future<dynamic> f; |
17 asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> /* originally async */ { | 17 asy::Future<core::int> t1 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> async => await new self::MyFuture::value<core::int>(3)); |
18 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::
sync<asy::FutureOr<core::int>>(); | 18 asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> async { |
19 asy::FutureOr<core::int> :return_value; | 19 return await new self::MyFuture::value<core::int>(3); |
20 dynamic :async_op_then; | |
21 dynamic :async_op_error; | |
22 dynamic :await_jump_var = 0; | |
23 dynamic :await_ctx_var; | |
24 dynamic :saved_try_context_var0; | |
25 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding | |
26 try { | |
27 #L1: | |
28 { | |
29 asy::_awaitHelper(new self::MyFuture::value<core::int>(3), :async_op_t
hen, :async_op_error, :async_op); | |
30 [yield] null; | |
31 :return_value = :result; | |
32 break #L1; | |
33 } | |
34 :completer.complete(:return_value); | |
35 return; | |
36 } | |
37 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
38 :completer.completeError(:exception, :stack_trace); | |
39 } | |
40 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
41 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
42 asy::Future::microtask<dynamic>(:async_op); | |
43 return :completer.future; | |
44 }); | 20 }); |
45 asy::Future<core::int> t2 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> /* originally async */ { | 21 asy::Future<core::int> t3 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> async => 3); |
46 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::
sync<asy::FutureOr<core::int>>(); | 22 asy::Future<core::int> t4 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> async { |
47 asy::FutureOr<core::int> :return_value; | 23 return 3; |
48 dynamic :async_op_then; | |
49 dynamic :async_op_error; | |
50 dynamic :await_jump_var = 0; | |
51 dynamic :await_ctx_var; | |
52 dynamic :saved_try_context_var0; | |
53 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding | |
54 try { | |
55 #L2: | |
56 { | |
57 asy::_awaitHelper(new self::MyFuture::value<core::int>(3), :async_op_t
hen, :async_op_error, :async_op); | |
58 [yield] null; | |
59 :return_value = :result; | |
60 break #L2; | |
61 } | |
62 :completer.complete(:return_value); | |
63 return; | |
64 } | |
65 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
66 :completer.completeError(:exception, :stack_trace); | |
67 } | |
68 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
69 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
70 asy::Future::microtask<dynamic>(:async_op); | |
71 return :completer.future; | |
72 }); | |
73 asy::Future<core::int> t3 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> /* originally async */ { | |
74 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::
sync<asy::FutureOr<core::int>>(); | |
75 asy::FutureOr<core::int> :return_value; | |
76 dynamic :async_op_then; | |
77 dynamic :async_op_error; | |
78 dynamic :await_jump_var = 0; | |
79 dynamic :await_ctx_var; | |
80 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding | |
81 try { | |
82 #L3: | |
83 { | |
84 :return_value = 3; | |
85 break #L3; | |
86 } | |
87 :completer.complete(:return_value); | |
88 return; | |
89 } | |
90 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
91 :completer.completeError(:exception, :stack_trace); | |
92 } | |
93 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
94 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
95 asy::Future::microtask<dynamic>(:async_op); | |
96 return :completer.future; | |
97 }); | |
98 asy::Future<core::int> t4 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> /* originally async */ { | |
99 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::
sync<asy::FutureOr<core::int>>(); | |
100 asy::FutureOr<core::int> :return_value; | |
101 dynamic :async_op_then; | |
102 dynamic :async_op_error; | |
103 dynamic :await_jump_var = 0; | |
104 dynamic :await_ctx_var; | |
105 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding | |
106 try { | |
107 #L4: | |
108 { | |
109 :return_value = 3; | |
110 break #L4; | |
111 } | |
112 :completer.complete(:return_value); | |
113 return; | |
114 } | |
115 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
116 :completer.completeError(:exception, :stack_trace); | |
117 } | |
118 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
119 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
120 asy::Future::microtask<dynamic>(:async_op); | |
121 return :completer.future; | |
122 }); | 24 }); |
123 asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((dynamic _) → sel
f::MyFuture<core::int> => new self::MyFuture::value<core::int>(3)); | 25 asy::Future<core::int> t5 = f.{asy::Future::then}<core::int>((dynamic _) → sel
f::MyFuture<core::int> => new self::MyFuture::value<core::int>(3)); |
124 asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((dynamic _) → sel
f::MyFuture<core::int> { | 26 asy::Future<core::int> t6 = f.{asy::Future::then}<core::int>((dynamic _) → sel
f::MyFuture<core::int> { |
125 return new self::MyFuture::value<core::int>(3); | 27 return new self::MyFuture::value<core::int>(3); |
126 }); | 28 }); |
127 asy::Future<core::int> t7 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> /* originally async */ { | 29 asy::Future<core::int> t7 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> async => new self::MyFuture::value<core::int>(3)); |
128 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::
sync<asy::FutureOr<core::int>>(); | 30 asy::Future<core::int> t8 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> async { |
129 asy::FutureOr<core::int> :return_value; | 31 return new self::MyFuture::value<core::int>(3); |
130 dynamic :async_op_then; | |
131 dynamic :async_op_error; | |
132 dynamic :await_jump_var = 0; | |
133 dynamic :await_ctx_var; | |
134 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding | |
135 try { | |
136 #L5: | |
137 { | |
138 :return_value = new self::MyFuture::value<core::int>(3); | |
139 break #L5; | |
140 } | |
141 :completer.complete(:return_value); | |
142 return; | |
143 } | |
144 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
145 :completer.completeError(:exception, :stack_trace); | |
146 } | |
147 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
148 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
149 asy::Future::microtask<dynamic>(:async_op); | |
150 return :completer.future; | |
151 }); | |
152 asy::Future<core::int> t8 = f.{asy::Future::then}<core::int>((dynamic _) → asy
::Future<core::int> /* originally async */ { | |
153 final asy::Completer<asy::FutureOr<core::int>> :completer = asy::Completer::
sync<asy::FutureOr<core::int>>(); | |
154 asy::FutureOr<core::int> :return_value; | |
155 dynamic :async_op_then; | |
156 dynamic :async_op_error; | |
157 dynamic :await_jump_var = 0; | |
158 dynamic :await_ctx_var; | |
159 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trac
e]) → dynamic yielding | |
160 try { | |
161 #L6: | |
162 { | |
163 :return_value = new self::MyFuture::value<core::int>(3); | |
164 break #L6; | |
165 } | |
166 :completer.complete(:return_value); | |
167 return; | |
168 } | |
169 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
170 :completer.completeError(:exception, :stack_trace); | |
171 } | |
172 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
173 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
174 asy::Future::microtask<dynamic>(:async_op); | |
175 return :completer.future; | |
176 }); | 32 }); |
177 } | 33 } |
178 static method main() → dynamic {} | 34 static method main() → dynamic {} |
OLD | NEW |