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

Unified Diff: lib/test.dart

Issue 1159923010: Use the Zone API for registerException. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: more changes Created 5 years, 7 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
« CHANGELOG.md ('K') | « lib/src/frontend/future_matchers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/test.dart
diff --git a/lib/test.dart b/lib/test.dart
index 505a08affe033ab234b6dcecb2b7f9f7b2ce267d..ffe8ff24db955b737b9e13bbc5e7ba0d5c913b21 100644
--- a/lib/test.dart
+++ b/lib/test.dart
@@ -173,5 +173,8 @@ void setUp(callback()) => _declarer.setUp(callback);
void tearDown(callback()) => _declarer.tearDown(callback);
/// Registers an exception that was caught for the current test.
-void registerException(error, [StackTrace stackTrace]) =>
- Invoker.current.handleError(error, stackTrace);
+void registerException(error, [StackTrace stackTrace]) {
+ // This will usually forward directly to [Invoker.current.handleError], but
+ // going through the zone API allows other zones to consistently see errors.
+ Zone.current.handleUncaughtError(error, stackTrace);
+}
« CHANGELOG.md ('K') | « lib/src/frontend/future_matchers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698