OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of "async.dart"; | 5 part of dart.async; |
6 | 6 |
7 /** The onValue and onError handlers return either a value or a future */ | 7 /** The onValue and onError handlers return either a value or a future */ |
8 typedef FutureOr<T> _FutureOnValue<S, T>(S value); | 8 typedef FutureOr<T> _FutureOnValue<S, T>(S value); |
9 /** Test used by [Future.catchError] to handle skip some errors. */ | 9 /** Test used by [Future.catchError] to handle skip some errors. */ |
10 typedef bool _FutureErrorTest(Object error); | 10 typedef bool _FutureErrorTest(Object error); |
11 /** Used by [WhenFuture]. */ | 11 /** Used by [WhenFuture]. */ |
12 typedef dynamic _FutureAction(); | 12 typedef dynamic _FutureAction(); |
13 | 13 |
14 abstract class _Completer<T> implements Completer<T> { | 14 abstract class _Completer<T> implements Completer<T> { |
15 final _Future<T> future = new _Future<T>(); | 15 final _Future<T> future = new _Future<T>(); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 } | 735 } |
736 }, onError: (e, s) { | 736 }, onError: (e, s) { |
737 if (timer.isActive) { | 737 if (timer.isActive) { |
738 timer.cancel(); | 738 timer.cancel(); |
739 result._completeError(e, s); | 739 result._completeError(e, s); |
740 } | 740 } |
741 }); | 741 }); |
742 return result; | 742 return result; |
743 } | 743 } |
744 } | 744 } |
OLD | NEW |