Index: sdk/lib/_internal/pub/lib/src/dart.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart |
index e0701a4bffa47dbdbc5d40a13175c3c667ea725a..3b49156c8d7e43f155422a0b18c0f5c48d4a7780 100644 |
--- a/sdk/lib/_internal/pub/lib/src/dart.dart |
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart |
@@ -165,7 +165,7 @@ class CrossIsolateException implements Exception { |
/// Serializes [error] to an object that can safely be passed across isolate |
/// boundaries. |
static Map serialize(error, [StackTrace stack]) { |
- if (stack == null) stack = getAttachedStackTrace(error); |
+ if (stack == null && error is Error) stack = error.stackTrace; |
return { |
'type': error.runtimeType.toString(), |
'message': getErrorMessage(error), |