| 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 dart.async; | 5 part of dart.async; |
| 6 | 6 |
| 7 deprecatedFutureValue(_FutureImpl future) => | 7 deprecatedFutureValue(_FutureImpl future) => |
| 8 future._isComplete ? future._resultOrListeners : null; | 8 future._isComplete ? future._resultOrListeners : null; |
| 9 | 9 |
| 10 | 10 |
| 11 class _CompleterImpl<T> implements Completer<T> { | 11 class _CompleterImpl<T> implements Completer<T> { |
| 12 final Future<T> future; | 12 final Future<T> future; |
| 13 bool _isComplete = false; | 13 bool _isComplete = false; |
| 14 | 14 |
| 15 _CompleterImpl() : future = new _FutureImpl<T>(); | 15 _CompleterImpl() : future = new _FutureImpl<T>(); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 Future catchError(function(AsyncError error), {bool test(var error)}) { | 453 Future catchError(function(AsyncError error), {bool test(var error)}) { |
| 454 return _future.catchError(function, test: test); | 454 return _future.catchError(function, test: test); |
| 455 } | 455 } |
| 456 | 456 |
| 457 Future whenComplete(void action()) { | 457 Future whenComplete(void action()) { |
| 458 return _future.whenComplete(action); | 458 return _future.whenComplete(action); |
| 459 } | 459 } |
| 460 | 460 |
| 461 Stream<T> asStream() => new Stream.fromFuture(this); | 461 Stream<T> asStream() => new Stream.fromFuture(this); |
| 462 } | 462 } |
| OLD | NEW |