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 /// A library for compiling Dart code and manipulating analyzer parse trees. | 5 /// A library for compiling Dart code and manipulating analyzer parse trees. |
6 library pub.dart; | 6 library pub.dart; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
11 | 11 |
12 import 'package:analyzer/analyzer.dart'; | 12 import 'package:analyzer/analyzer.dart'; |
13 import 'package:path/path.dart' as path; | 13 import 'package:path/path.dart' as path; |
14 | 14 |
15 import 'package:compiler_unsupported/compiler.dart' as compiler; | 15 import 'package:compiler_unsupported/compiler.dart' as compiler; |
16 import 'package:compiler_unsupported/src/filenames.dart' | 16 import 'package:compiler_unsupported/src/filenames.dart' |
17 show appendSlash; | 17 show appendSlash; |
18 | 18 |
19 import '../../asset/dart/serialize.dart'; | 19 import 'asset/dart/serialize.dart'; |
20 import 'io.dart'; | 20 import 'io.dart'; |
21 import 'log.dart' as log; | 21 import 'log.dart' as log; |
22 | 22 |
23 /// Interface to communicate with dart2js. | 23 /// Interface to communicate with dart2js. |
24 /// | 24 /// |
25 /// This is basically an amalgamation of dart2js's | 25 /// This is basically an amalgamation of dart2js's |
26 /// [compiler.CompilerInputProvider], [compiler.CompilerOutputProvider], and | 26 /// [compiler.CompilerInputProvider], [compiler.CompilerOutputProvider], and |
27 /// [compiler.DiagnosticHandler] function types so that we can provide them | 27 /// [compiler.DiagnosticHandler] function types so that we can provide them |
28 /// as a single unit. | 28 /// as a single unit. |
29 abstract class CompilerProvider { | 29 abstract class CompilerProvider { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 Isolate.spawnUri(Uri.parse(message['uri']), [], message['message'], | 216 Isolate.spawnUri(Uri.parse(message['uri']), [], message['message'], |
217 packageRoot: packageRoot) | 217 packageRoot: packageRoot) |
218 .then((_) => replyTo.send({'type': 'success'})) | 218 .then((_) => replyTo.send({'type': 'success'})) |
219 .catchError((e, stack) { | 219 .catchError((e, stack) { |
220 replyTo.send({ | 220 replyTo.send({ |
221 'type': 'error', | 221 'type': 'error', |
222 'error': CrossIsolateException.serialize(e, stack) | 222 'error': CrossIsolateException.serialize(e, stack) |
223 }); | 223 }); |
224 }); | 224 }); |
225 } | 225 } |
OLD | NEW |