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 = null]) → void | 9 constructor value([dynamic x = null]) → 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 field self::MyFuture<dynamic> f; | 15 static field self::MyFuture<dynamic> f; |
16 static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::in
t>((dynamic _) → self::MyFuture<core::int> => new self::MyFuture::value<core::in
t>("hi")); | 16 static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::in
t>((dynamic _) → self::MyFuture<core::int> => new self::MyFuture::value<core::in
t>("hi")); |
17 static field asy::Future<core::List<core::int>> t2 = self::f.{self::MyFuture::th
en}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]
); | 17 static field asy::Future<core::List<core::int>> t2 = self::f.{self::MyFuture::th
en}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]
); |
18 static method g2() → asy::Future<core::List<core::int>> /* originally async */ { | 18 static method g2() → asy::Future<core::List<core::int>> async { |
19 final asy::Completer<asy::FutureOr<core::List<core::int>>> :completer = asy::C
ompleter::sync<asy::FutureOr<core::List<core::int>>>(); | 19 return <core::int>[3]; |
20 asy::FutureOr<core::List<core::int>> :return_value; | |
21 dynamic :async_op_then; | |
22 dynamic :async_op_error; | |
23 dynamic :await_jump_var = 0; | |
24 dynamic :await_ctx_var; | |
25 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]
) → dynamic yielding | |
26 try { | |
27 #L1: | |
28 { | |
29 :return_value = <core::int>[3]; | |
30 break #L1; | |
31 } | |
32 :completer.complete(:return_value); | |
33 return; | |
34 } | |
35 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
36 :completer.completeError(:exception, :stack_trace); | |
37 } | |
38 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
39 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
40 asy::Future::microtask<dynamic>(:async_op); | |
41 return :completer.future; | |
42 } | 20 } |
43 static method g3() → asy::Future<core::List<core::int>> /* originally async */ { | 21 static method g3() → asy::Future<core::List<core::int>> async { |
44 final asy::Completer<asy::FutureOr<core::List<core::int>>> :completer = asy::C
ompleter::sync<asy::FutureOr<core::List<core::int>>>(); | 22 return new self::MyFuture::value<core::List<core::int>>(<core::int>[3]); |
45 asy::FutureOr<core::List<core::int>> :return_value; | |
46 dynamic :async_op_then; | |
47 dynamic :async_op_error; | |
48 dynamic :await_jump_var = 0; | |
49 dynamic :await_ctx_var; | |
50 function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]
) → dynamic yielding | |
51 try { | |
52 #L2: | |
53 { | |
54 :return_value = new self::MyFuture::value<core::List<core::int>>(<core::
int>[3]); | |
55 break #L2; | |
56 } | |
57 :completer.complete(:return_value); | |
58 return; | |
59 } | |
60 on dynamic catch(dynamic :exception, dynamic :stack_trace) { | |
61 :completer.completeError(:exception, :stack_trace); | |
62 } | |
63 :async_op_then = asy::_asyncThenWrapperHelper(:async_op); | |
64 :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); | |
65 asy::Future::microtask<dynamic>(:async_op); | |
66 return :completer.future; | |
67 } | 23 } |
68 static method main() → dynamic {} | 24 static method main() → dynamic {} |
OLD | NEW |