OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 leg_apiimpl; | 5 library leg_apiimpl; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../compiler.dart' as api; | 9 import '../compiler.dart' as api; |
10 import 'dart2jslib.dart' as leg; | 10 import 'dart2jslib.dart' as leg; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 hasOption(options, '--enable-concrete-type-inference'), | 55 hasOption(options, '--enable-concrete-type-inference'), |
56 disableTypeInferenceFlag: | 56 disableTypeInferenceFlag: |
57 hasOption(options, '--disable-type-inference'), | 57 hasOption(options, '--disable-type-inference'), |
58 preserveComments: hasOption(options, '--preserve-comments'), | 58 preserveComments: hasOption(options, '--preserve-comments'), |
59 verbose: hasOption(options, '--verbose'), | 59 verbose: hasOption(options, '--verbose'), |
60 sourceMapUri: extractSourceMapUri(options), | 60 sourceMapUri: extractSourceMapUri(options), |
61 terseDiagnostics: hasOption(options, '--terse'), | 61 terseDiagnostics: hasOption(options, '--terse'), |
62 dumpInfo: hasOption(options, '--dump-info'), | 62 dumpInfo: hasOption(options, '--dump-info'), |
63 buildId: extractStringOption( | 63 buildId: extractStringOption( |
64 options, '--build-id=', | 64 options, '--build-id=', |
65 "build number could not be determined")) { | 65 "build number could not be determined"), |
| 66 hidePackageWarnings: |
| 67 hasOption(options, '--hide-package-warnings')) { |
66 if (!libraryRoot.path.endsWith("/")) { | 68 if (!libraryRoot.path.endsWith("/")) { |
67 throw new ArgumentError("libraryRoot must end with a /"); | 69 throw new ArgumentError("libraryRoot must end with a /"); |
68 } | 70 } |
69 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | 71 if (packageRoot != null && !packageRoot.path.endsWith("/")) { |
70 throw new ArgumentError("packageRoot must end with a /"); | 72 throw new ArgumentError("packageRoot must end with a /"); |
71 } | 73 } |
72 } | 74 } |
73 | 75 |
74 static String extractStringOption(List<String> options, | 76 static String extractStringOption(List<String> options, |
75 String prefix, | 77 String prefix, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 331 } |
330 | 332 |
331 void diagnoseCrashInUserCode(String message, exception, stackTrace) { | 333 void diagnoseCrashInUserCode(String message, exception, stackTrace) { |
332 hasCrashed = true; | 334 hasCrashed = true; |
333 print('$message: ${tryToString(exception)}'); | 335 print('$message: ${tryToString(exception)}'); |
334 print(tryToString(stackTrace)); | 336 print(tryToString(stackTrace)); |
335 } | 337 } |
336 | 338 |
337 fromEnvironment(String name) => environment[name]; | 339 fromEnvironment(String name) => environment[name]; |
338 } | 340 } |
OLD | NEW |