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

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

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 2 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/async_error.dart
diff --git a/sdk/lib/async/async_error.dart b/sdk/lib/async/async_error.dart
index 0990d4da4797887db298475da26e4757d4e083ae..cac1e4ddcf64878b830f985f3c80634f1fd0cb0d 100644
--- a/sdk/lib/async/async_error.dart
+++ b/sdk/lib/async/async_error.dart
@@ -4,13 +4,6 @@
part of dart.async;
-final Expando _stackTraceExpando = new Expando("asynchronous error");
-
-void _attachStackTrace(o, StackTrace st) {
- if (o == null || o is bool || o is num || o is String) return;
- _stackTraceExpando[o] = st;
-}
-
_invokeErrorHandler(Function errorHandler,
Object error, StackTrace stackTrace) {
if (errorHandler is ZoneBinaryCallback) {
@@ -28,22 +21,6 @@ Function _registerErrorHandler(Function errorHandler, Zone zone) {
}
}
-/**
- * *DEPRECATED*. Use explicit stack trace arguments instead.
- *
- * Get the [StackTrace] attached to [o].
- *
- * If object [o] was thrown and caught in a dart:async method, a [StackTrace]
- * object was attached to it. Use [getAttachedStackTrace] to get that object.
- *
- * Returns [null] if no [StackTrace] was attached.
- */
-@deprecated
-getAttachedStackTrace(o) {
- if (o == null || o is bool || o is num || o is String) return null;
- return _stackTraceExpando[o];
-}
-
class _AsyncError implements Error {
final error;
final StackTrace stackTrace;
@@ -53,18 +30,12 @@ class _AsyncError implements Error {
class _UncaughtAsyncError extends _AsyncError {
_UncaughtAsyncError(error, StackTrace stackTrace)
- : super(error, _getBestStackTrace(error, stackTrace)) {
- // Clear the attached stack trace.
- _attachStackTrace(error, null);
- }
+ : super(error, _getBestStackTrace(error, stackTrace));
static StackTrace _getBestStackTrace(error, StackTrace stackTrace) {
if (stackTrace != null) return stackTrace;
- var trace = getAttachedStackTrace(error);
- if (trace != null) return trace;
if (error is Error) {
- Error e = error;
- return e.stackTrace;
+ return error.stackTrace;
}
return null;
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart ('k') | sdk/lib/async/broadcast_stream_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698