| 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:isolate'; | 9 import 'dart:isolate'; |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 Future compile(String entrypoint, CompilerProvider provider, { | 52 Future compile(String entrypoint, CompilerProvider provider, { |
| 53 Iterable<String> commandLineOptions, | 53 Iterable<String> commandLineOptions, |
| 54 bool checked: false, | 54 bool checked: false, |
| 55 bool minify: true, | 55 bool minify: true, |
| 56 bool verbose: false, | 56 bool verbose: false, |
| 57 Map<String, String> environment, | 57 Map<String, String> environment, |
| 58 String packageRoot, | 58 String packageRoot, |
| 59 bool analyzeAll: false, | 59 bool analyzeAll: false, |
| 60 bool suppressWarnings: false, | 60 bool suppressWarnings: false, |
| 61 bool suppressHints: false, | 61 bool suppressHints: false, |
| 62 bool suppressPackageWarnings: true, |
| 62 bool terse: false, | 63 bool terse: false, |
| 63 bool toDart: false}) { | 64 bool toDart: false}) { |
| 64 return syncFuture(() { | 65 return syncFuture(() { |
| 65 var options = <String>['--categories=Client,Server']; | 66 var options = <String>['--categories=Client,Server']; |
| 66 if (checked) options.add('--checked'); | 67 if (checked) options.add('--checked'); |
| 67 if (minify) options.add('--minify'); | 68 if (minify) options.add('--minify'); |
| 68 if (verbose) options.add('--verbose'); | 69 if (verbose) options.add('--verbose'); |
| 69 if (analyzeAll) options.add('--analyze-all'); | 70 if (analyzeAll) options.add('--analyze-all'); |
| 70 if (suppressWarnings) options.add('--suppress-warnings'); | 71 if (suppressWarnings) options.add('--suppress-warnings'); |
| 71 if (suppressHints) options.add('--suppress-hints'); | 72 if (suppressHints) options.add('--suppress-hints'); |
| 73 if (suppressPackageWarnings) options.add('--hide-package-warnings'); |
| 72 if (terse) options.add('--terse'); | 74 if (terse) options.add('--terse'); |
| 73 if (toDart) options.add('--output-type=dart'); | 75 if (toDart) options.add('--output-type=dart'); |
| 74 | 76 |
| 75 if (environment == null) environment = {}; | 77 if (environment == null) environment = {}; |
| 76 if (commandLineOptions != null) options.addAll(commandLineOptions); | 78 if (commandLineOptions != null) options.addAll(commandLineOptions); |
| 77 | 79 |
| 78 if (packageRoot == null) { | 80 if (packageRoot == null) { |
| 79 packageRoot = path.join(path.dirname(entrypoint), 'packages'); | 81 packageRoot = path.join(path.dirname(entrypoint), 'packages'); |
| 80 } | 82 } |
| 81 | 83 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (stack == null && error is Error) stack = error.stackTrace; | 195 if (stack == null && error is Error) stack = error.stackTrace; |
| 194 return { | 196 return { |
| 195 'type': error.runtimeType.toString(), | 197 'type': error.runtimeType.toString(), |
| 196 'message': getErrorMessage(error), | 198 'message': getErrorMessage(error), |
| 197 'stack': stack == null ? null : new Chain.forTrace(stack).toString() | 199 'stack': stack == null ? null : new Chain.forTrace(stack).toString() |
| 198 }; | 200 }; |
| 199 } | 201 } |
| 200 | 202 |
| 201 String toString() => "$message\n$stackTrace"; | 203 String toString() => "$message\n$stackTrace"; |
| 202 } | 204 } |
| OLD | NEW |