| Index: sdk/lib/async/zone.dart
|
| diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
|
| index 2306a6e646a72f38d4af7130ac73861ab4b9cc83..297f83ff4ccb21c7c61e7fa9f9e4a2aa61cd19d7 100644
|
| --- a/sdk/lib/async/zone.dart
|
| +++ b/sdk/lib/async/zone.dart
|
| @@ -701,16 +701,18 @@ class _CustomizedZone extends _BaseZone {
|
|
|
| void _rootHandleUncaughtError(
|
| Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace) {
|
| - _scheduleAsyncCallback(() {
|
| - print("Uncaught Error: ${error}");
|
| - var trace = stackTrace;
|
| - if (trace == null) trace = getAttachedStackTrace(error);
|
| - // Clear the attached stack trace (if any).
|
| - _attachStackTrace(error, null);
|
| - if (trace != null) {
|
| - print("Stack Trace: \n$trace\n");
|
| - }
|
| - throw error;
|
| + self.run(() {
|
| + _scheduleAsyncCallback(() {
|
| + print("Uncaught Error: ${error}");
|
| + var trace = stackTrace;
|
| + if (trace == null) trace = getAttachedStackTrace(error);
|
| + // Clear the attached stack trace (if any).
|
| + _attachStackTrace(error, null);
|
| + if (trace != null) {
|
| + print("Stack Trace: \n$trace\n");
|
| + }
|
| + throw error;
|
| + });
|
| });
|
| }
|
|
|
| @@ -849,6 +851,14 @@ class _RootZone extends _BaseZone {
|
|
|
| operator [](Symbol key) => null;
|
|
|
| + dynamic runUnaryGuarded(f, arg) {
|
| + try {
|
| + return runUnary(f, arg);
|
| + } catch (e, s) {
|
| + return handleUncaughtError(e, s);
|
| + }
|
| + }
|
| +
|
| // Methods that can be customized by the zone specification.
|
|
|
| dynamic handleUncaughtError(error, StackTrace stackTrace) =>
|
|
|