Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart b/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
| index 83a5a8c6f47fa7e4de40f192ae04a12a1a326e6a..5fdb86c1bbad67773e4f503b3e6ba39c8552d9fb 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
| @@ -295,26 +295,33 @@ class CrossIsolateException implements Exception { |
| /// property. |
| final String message; |
| - /// The exception's stack trace, or `null` if no stack trace was available. |
| - final Trace stackTrace; |
| + /// The exception's stack chain, or `null` if no stack chain was available. |
| + final Chain stackTrace; |
| - /// Loads a [CrossIsolateException] from a map. |
| + /// Loads a [CrossIsolateException] from a serialized representation. |
| /// |
| /// [error] should be the result of [CrossIsolateException.serialize]. |
| - CrossIsolateException.deserialize(Map error) |
| - : type = error['type'], |
| - message = error['message'], |
| - stackTrace = error['stack'] == null ? null : |
| - new Trace.parse(error['stack']); |
| + factory CrossIsolateException.deserialize(Map error) { |
| + var type = error['type']; |
| + var message = error['message']; |
| + var stackTrace = error['stack'] == null ? null : |
| + new Chain.parse(error['stack']); |
| + return new CrossIsolateException._(type, message, stackTrace); |
| + } |
| + |
| + /// Loads a [CrossIsolateException] from a serialized representation. |
| + /// |
| + /// [error] should be the result of [CrossIsolateException.serialize]. |
|
Bob Nystrom
2013/12/04 17:37:21
Update the doc comment.
nweiz
2013/12/04 22:41:30
I've just gone back to not using a factory constru
|
| + CrossIsolateException._(this.type, this.message, this.stackTrace); |
| - /// Serializes [error] to a map that can safely be passed across isolate |
| + /// Serializes [error] to an object that can safely be passed across isolate |
| /// boundaries. |
| static Map serialize(error, [StackTrace stack]) { |
| if (stack == null && error is Error) stack = error.stackTrace; |
| return { |
| 'type': error.runtimeType.toString(), |
| 'message': getErrorMessage(error), |
| - 'stack': stack == null ? null : stack.toString() |
| + 'stack': stack == null ? null : new Chain.forTrace(stack).toString() |
| }; |
| } |