| library test; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| |
| import "dart:async"; |
| |
| class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> { |
| constructor •() → self::MyFuture<self::MyFuture::T> |
| : super core::Object::•() {} |
| constructor value(self::MyFuture::T x) → self::MyFuture<self::MyFuture::T> |
| : super core::Object::•() {} |
| method noSuchMethod(dynamic invocation) → dynamic |
| return null; |
| method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S> |
| return null; |
| no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T> |
| return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}))) as{TypeError} asy::Future<self::MyFuture::T>; |
| no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T> |
| return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} asy::Future<self::MyFuture::T>; |
| no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T> |
| return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}))) as{TypeError} asy::Future<self::MyFuture::T>; |
| no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T> |
| return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} asy::Stream<self::MyFuture::T>; |
| } |
| static method test() → void { |
| self::MyFuture<core::bool> f; |
| self::MyFuture<core::int> t1 = f.then((dynamic x) → asy::Future<dynamic> /* originally async */ { |
| final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>(); |
| asy::FutureOr<dynamic> :return_value; |
| dynamic :async_stack_trace; |
| dynamic :async_op_then; |
| dynamic :async_op_error; |
| dynamic :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| dynamic :saved_try_context_var0; |
| dynamic :async_temporary_0; |
| function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding |
| try { |
| #L1: |
| { |
| if(x) { |
| :async_temporary_0 = 2; |
| } |
| else { |
| [yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::value<core::int>(3), :async_op_then, :async_op_error, :async_op) in null; |
| :async_temporary_0 = :result; |
| } |
| :return_value = :async_temporary_0; |
| break #L1; |
| } |
| asy::_completeOnAsyncReturn(:async_completer, :return_value); |
| return; |
| } |
| on dynamic catch(dynamic :exception, dynamic :stack_trace) { |
| :async_completer.{asy::Completer::completeError}(:exception, :stack_trace); |
| } |
| :async_stack_trace = asy::_asyncStackTraceHelper(:async_op); |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_completer.start(:async_op); |
| return :async_completer.{asy::Completer::future}; |
| }); |
| self::MyFuture<core::int> t2 = f.then((dynamic x) → asy::Future<dynamic> /* originally async */ { |
| final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>(); |
| asy::FutureOr<dynamic> :return_value; |
| dynamic :async_stack_trace; |
| dynamic :async_op_then; |
| dynamic :async_op_error; |
| dynamic :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| dynamic :saved_try_context_var0; |
| function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding |
| try { |
| #L2: |
| { |
| [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null; |
| :return_value = :result ? 2 : asy::Future::value<core::int>(3); |
| break #L2; |
| } |
| asy::_completeOnAsyncReturn(:async_completer, :return_value); |
| return; |
| } |
| on dynamic catch(dynamic :exception, dynamic :stack_trace) { |
| :async_completer.{asy::Completer::completeError}(:exception, :stack_trace); |
| } |
| :async_stack_trace = asy::_asyncStackTraceHelper(:async_op); |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_completer.start(:async_op); |
| return :async_completer.{asy::Completer::future}; |
| }); |
| self::MyFuture<core::int> t5 = f.then((dynamic x) → dynamic => x ? 2 : asy::Future::value<core::int>(3)); |
| self::MyFuture<core::int> t6 = f.then((dynamic x) → dynamic { |
| return x ? 2 : asy::Future::value<core::int>(3); |
| }); |
| } |
| static method main() → dynamic {} |