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

Unified Diff: sdk/lib/async/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/async/async_error.dart ('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 96bf0cc4c107996bfb0e2c0de88a0eecd52bfb97..c5818251c498e0de4871ed55f07e0c1c903a1c14 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -25,7 +25,7 @@ part of dart.async;
* // Invoked when the future is completed with a value.
* return 42; // The successor is completed with the value 42.
* },
- * onError: (AsyncError e) {
+ * onError: (e) {
* // Invoked when the future is completed with an error.
* if (canHandle(e)) {
* return 499; // The successor is completed with the value 499.
@@ -102,9 +102,6 @@ abstract class Future<T> {
* If the returned value is itself a [Future], completion of
* the created future will wait until the returned future completes,
* and will then complete with the same result.
- *
- * If a thrown value is an [AsyncError], it is used directly as the result
- * of the created future.
*/
factory Future.of(function()) {
try {
@@ -207,9 +204,7 @@ abstract class Future<T> {
* [this] completes with an error).
*
* If the invoked callback throws an exception, the returned future `f` is
- * completed with the error. If the value thrown is an [AsyncError], it is
- * used directly, as the error result. Otherwise it is wrapped in an
- * [AsyncError] first.
+ * completed with the error.
*
* If the invoked callback returns a [Future] `f2` then `f` and `f2` are
* chained. That is, `f` is completed with the completion value of `f2`.
@@ -221,7 +216,7 @@ abstract class Future<T> {
* with a `test` parameter, instead of handling both value and error in a
* single [then] call.
*/
- Future then(onValue(T value), { onError(AsyncError asyncError) });
+ Future then(onValue(T value), { onError(Object error) });
/**
* Handles errors emitted by this [Future].
@@ -233,8 +228,8 @@ abstract class Future<T> {
*
* When [this] completes with an error, [test] is called with the
* error's value. If the invocation returns [true], [onError] is called with
- * the error wrapped in an [AsyncError]. The result of [onError] is handled
- * exactly the same as for [then]'s [onError].
+ * the error. The result of [onError] is handled exactly the same as for
+ * [then]'s [onError].
*
* If [test] returns false, the exception is not handled by [onError], but is
* thrown unmodified, thus forwarding it to `f`.
@@ -250,12 +245,12 @@ abstract class Future<T> {
*
* This method is equivalent to:
*
- * Future catchError(onError(AsyncError asyncError),
- * {bool test(Object error)}) {
+ * Future catchError(onError(error),
+ * {bool test(error)}) {
* this.then((v) => v, // Forward the value.
* // But handle errors, if the [test] succeeds.
- * onError: (AsyncError e) {
- * if (test == null || test(e.error)) {
+ * onError: (e) {
+ * if (test == null || test(e)) {
* return onError(e);
* }
* throw e;
@@ -263,7 +258,7 @@ abstract class Future<T> {
* }
*
*/
- Future catchError(onError(AsyncError asyncError),
+ Future catchError(onError(Object error),
{bool test(Object error)});
/**
@@ -295,7 +290,7 @@ abstract class Future<T> {
* if (f2 is Future) return f2.then((_) => v);
* return v
* },
- * onError: (AsyncError e) {
+ * onError: (e) {
* var f2 = action();
* if (f2 is Future) return f2.then((_) { throw e; });
* throw e;
@@ -352,12 +347,6 @@ abstract class Completer<T> {
* while trying to produce a value.
*
* The argument [exception] should not be `null`.
- *
- * If [exception] is an [AsyncError], it is used directly as the error
- * message sent to the future's listeners, and [stackTrace] is ignored.
- *
- * Otherwise the [exception] and an optional [stackTrace] is combined into an
- * [AsyncError] and sent to this future's listeners.
*/
void completeError(Object exception, [Object stackTrace]);
« no previous file with comments | « sdk/lib/async/async_error.dart ('k') | sdk/lib/async/future_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698