Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: pkg/scheduled_test/lib/src/value_future.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library value_future; 5 library value_future;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 /// A [Future] wrapper that provides synchronous access to the value of the 9 /// A [Future] wrapper that provides synchronous access to the value of the
10 /// wrapped [Future] once it's completed. 10 /// wrapped [Future] once it's completed.
(...skipping 12 matching lines...) Expand all
23 23
24 ValueFuture(Future<T> future) { 24 ValueFuture(Future<T> future) {
25 _future = future.then((value) { 25 _future = future.then((value) {
26 _value = value; 26 _value = value;
27 _hasValue = true; 27 _hasValue = true;
28 return value; 28 return value;
29 }); 29 });
30 } 30 }
31 31
32 Stream<T> asStream() => _future.asStream(); 32 Stream<T> asStream() => _future.asStream();
33 Future catchError(onError(AsyncError asyncError), {bool test(error)}) => 33 Future catchError(onError(Object error), {bool test(error)}) =>
34 _future.catchError(onError, test: test); 34 _future.catchError(onError, test: test);
35 Future then(onValue(T value), {onError(AsyncError asyncError)}) => 35 Future then(onValue(T value), {onError(Object error)}) =>
36 _future.then(onValue, onError: onError); 36 _future.then(onValue, onError: onError);
37 Future<T> whenComplete(action()) => _future.whenComplete(action); 37 Future<T> whenComplete(action()) => _future.whenComplete(action);
38 } 38 }
OLDNEW
« no previous file with comments | « pkg/scheduled_test/lib/src/utils.dart ('k') | pkg/scheduled_test/test/scheduled_test/capture_stack_traces_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698