| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library pub.transformer_isolate; | 5 library pub.transformer_isolate; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 | 10 |
| 11 import 'package:barback/barback.dart'; | 11 import 'package:barback/barback.dart'; |
| 12 import 'package:source_maps/source_maps.dart'; | 12 import 'package:source_span/source_span.dart'; |
| 13 import 'package:stack_trace/stack_trace.dart'; | 13 import 'package:stack_trace/stack_trace.dart'; |
| 14 | 14 |
| 15 import '../../../asset/dart/serialize.dart'; | 15 import '../../../asset/dart/serialize.dart'; |
| 16 import '../barback.dart'; | 16 import '../barback.dart'; |
| 17 import '../exceptions.dart'; | 17 import '../exceptions.dart'; |
| 18 import '../dart.dart' as dart; | 18 import '../dart.dart' as dart; |
| 19 import '../log.dart' as log; | 19 import '../log.dart' as log; |
| 20 import '../utils.dart'; | 20 import '../utils.dart'; |
| 21 import 'asset_environment.dart'; | 21 import 'asset_environment.dart'; |
| 22 import 'barback_server.dart'; | 22 import 'barback_server.dart'; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 .toSet(); | 115 .toSet(); |
| 116 log.fine("Transformers from $config: $transformers"); | 116 log.fine("Transformers from $config: $transformers"); |
| 117 return transformers; | 117 return transformers; |
| 118 }).catchError((error, stackTrace) { | 118 }).catchError((error, stackTrace) { |
| 119 throw new TransformerLoadError(error, config.span); | 119 throw new TransformerLoadError(error, config.span); |
| 120 }); | 120 }); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 /// An error thrown when a transformer fails to load. | 124 /// An error thrown when a transformer fails to load. |
| 125 class TransformerLoadError extends SpanException implements WrappedException { | 125 class TransformerLoadError extends SourceSpanException |
| 126 implements WrappedException { |
| 126 final CrossIsolateException innerError; | 127 final CrossIsolateException innerError; |
| 127 Chain get innerChain => innerError.stackTrace; | 128 Chain get innerChain => innerError.stackTrace; |
| 128 | 129 |
| 129 TransformerLoadError(CrossIsolateException error, Span span) | 130 TransformerLoadError(CrossIsolateException error, SourceSpan span) |
| 130 : innerError = error, | 131 : innerError = error, |
| 131 super("Error loading transformer: ${error.message}", span); | 132 super("Error loading transformer: ${error.message}", span); |
| 132 } | 133 } |
| OLD | NEW |