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

Unified Diff: pkg/stack_trace/lib/src/chain.dart

Issue 556363004: Add an error callback to StackZoneSpecification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « pkg/stack_trace/README.md ('k') | pkg/stack_trace/lib/src/stack_zone_specification.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/lib/src/chain.dart
diff --git a/pkg/stack_trace/lib/src/chain.dart b/pkg/stack_trace/lib/src/chain.dart
index 78c6ae4014c37c9f7d49d3643f9f3c6ad3648cfa..e4ac534369ab21b726584b816c22194749ec9ed2 100644
--- a/pkg/stack_trace/lib/src/chain.dart
+++ b/pkg/stack_trace/lib/src/chain.dart
@@ -102,33 +102,13 @@ class Chain implements StackTrace {
});
}
- /// Ensures that any errors emitted by [futureOrStream] have the correct stack
- /// chain information associated with them.
- ///
- /// For the most part an error thrown within a [capture] zone will have the
- /// correct stack chain automatically associated with it. However, there are
- /// some cases where exceptions won't be automatically detected: any [Future]
- /// constructor, [Completer.completeError], [Stream.addError], and libraries
- /// that use these.
- ///
- /// This returns a [Future] or [Stream] that will emit the same values and
- /// errors as [futureOrStream]. The only exception is that if [futureOrStream]
- /// emits an error without a stack trace, one will be added in the return
- /// value.
- ///
- /// If this is called outside of a [capture] zone, it just returns
- /// [futureOrStream] as-is.
- ///
- /// As the name suggests, [futureOrStream] may be either a [Future] or a
- /// [Stream].
- static track(futureOrStream) {
- if (_currentSpec == null) return futureOrStream;
- if (futureOrStream is Future) {
- return _currentSpec.trackFuture(futureOrStream, 1);
- } else {
- return _currentSpec.trackStream(futureOrStream, 1);
- }
- }
+ /// Returns [futureOrStream] unmodified.
+ ///
+ /// Prior to Dart 1.7, this was necessary to ensure that stack traces for
+ /// exceptions reported with [Completer.completeError] and
+ /// [StreamController.addError] were tracked correctly.
+ @Deprecated("Chain.track is not necessary in Dart 1.7+.")
+ static track(futureOrStream) => futureOrStream;
/// Returns the current stack chain.
///
« no previous file with comments | « pkg/stack_trace/README.md ('k') | pkg/stack_trace/lib/src/stack_zone_specification.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698