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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild DOM and rebase. 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
Index: sdk/lib/async/stream_controller.dart
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index bd70b1074aeb97898623d8d1ddf76c98a4120a81..32645af965ae72cab3bc1cbeb9c28ef94f3e213f 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.dart
@@ -111,23 +111,16 @@ class StreamController<T> extends EventSink<T> {
/**
* Send or enqueue an error event.
*
- * If [error] is not an [AsyncError], [error] and an optional [stackTrace]
- * is combined into an [AsyncError] and sent this stream's listeners.
- *
- * Otherwise, if [error] is an [AsyncError], it is used directly as the
- * error object reported to listeners, and the [stackTrace] is ignored.
- *
* If a subscription has requested to be unsubscribed on errors,
* it will be unsubscribed after receiving this event.
*/
void addError(Object error, [Object stackTrace]) {
- AsyncError asyncError;
- if (error is AsyncError) {
- asyncError = error;
- } else {
- asyncError = new AsyncError(error, stackTrace);
+ if (stackTrace != null) {
+ // Force stack trace overwrite. Even if the error already contained
+ // a stack trace.
+ _attachStackTrace(error, stackTrace);
}
- stream._addError(asyncError);
+ stream._addError(error);
}
/**
@@ -152,7 +145,7 @@ class _MultiControllerStream<T> extends _MultiStreamImpl<T> {
try {
_subscriptionHandler();
} catch (e, s) {
- new AsyncError(e, s).throwDelayed();
+ _throwDelayed(e, s);
}
}
}
@@ -162,7 +155,7 @@ class _MultiControllerStream<T> extends _MultiStreamImpl<T> {
try {
_pauseHandler();
} catch (e, s) {
- new AsyncError(e, s).throwDelayed();
+ _throwDelayed(e, s);
}
}
}
@@ -179,7 +172,7 @@ class _SingleControllerStream<T> extends _SingleStreamImpl<T> {
try {
_subscriptionHandler();
} catch (e, s) {
- new AsyncError(e, s).throwDelayed();
+ _throwDelayed(e, s);
}
}
}
@@ -189,7 +182,7 @@ class _SingleControllerStream<T> extends _SingleStreamImpl<T> {
try {
_pauseHandler();
} catch (e, s) {
- new AsyncError(e, s).throwDelayed();
+ _throwDelayed(e, s);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698