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); |
+} |