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

Unified Diff: sdk/lib/async/future.dart

Issue 2724853002: Revert last 4 commits by lrn@ (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/parser.cc ('k') | sdk/lib/async/future_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/future.dart
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 3e5dd58d50f203eb4149b17a2af38bebf5137d80..355cd4c7606113807c63de5e303ed05cb1652294 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -553,15 +553,17 @@ abstract class Future<T> {
* }
*
*/
- // The `Function` below stands for one of two types:
- // - (dynamic) -> FutureOr<T>
- // - (dynamic, StackTrace) -> FutureOr<T>
+ // The `Function` below can stand for several types:
+ // - (dynamic) -> T
+ // - (dynamic, StackTrace) -> T
+ // - (dynamic) -> Future<T>
+ // - (dynamic, StackTrace) -> Future<T>
// Given that there is a `test` function that is usually used to do an
// `isCheck` we should also expect functions that take a specific argument.
// Note: making `catchError` return a `Future<T>` in non-strong mode could be
// a breaking change.
Future<T> catchError(Function onError,
- {bool test(Object error)});
+ {bool test(Object error)});
/**
* Register a function to be called when this future completes.
@@ -783,7 +785,7 @@ abstract class Completer<T> {
*
* All listeners on the future are informed about the value.
*/
- void complete([FutureOr<T> value]);
+ void complete([value]);
/**
* Complete [future] with an error.
@@ -825,4 +827,5 @@ void _completeWithErrorCallback(_Future result, error, stackTrace) {
}
/** Helper function that converts `null` to a [NullThrownError]. */
-Object _nonNullError(Object error) => error ?? new NullThrownError();
+Object _nonNullError(Object error) =>
+ (error != null) ? error : new NullThrownError();
« no previous file with comments | « runtime/vm/parser.cc ('k') | sdk/lib/async/future_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698