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:uri'; | 7 import 'dart:uri'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 | 9 |
10 import '../compiler.dart' as api; | 10 import '../compiler.dart' as api; |
(...skipping 25 matching lines...) Expand all Loading... |
36 emitJavaScript: !hasOption(options, '--output-type=dart'), | 36 emitJavaScript: !hasOption(options, '--output-type=dart'), |
37 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), | 37 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), |
38 analyzeAll: hasOption(options, '--analyze-all'), | 38 analyzeAll: hasOption(options, '--analyze-all'), |
39 rejectDeprecatedFeatures: | 39 rejectDeprecatedFeatures: |
40 hasOption(options, '--reject-deprecated-language-features'), | 40 hasOption(options, '--reject-deprecated-language-features'), |
41 checkDeprecationInSdk: | 41 checkDeprecationInSdk: |
42 hasOption(options, | 42 hasOption(options, |
43 '--report-sdk-use-of-deprecated-language-features'), | 43 '--report-sdk-use-of-deprecated-language-features'), |
44 strips: getStrips(options), | 44 strips: getStrips(options), |
45 enableConcreteTypeInference: | 45 enableConcreteTypeInference: |
46 hasOption(options, '--enable-concrete-type-inference')) { | 46 hasOption(options, '--enable-concrete-type-inference'), |
| 47 preserveComments: hasOption(options, '--preserve-comments')) { |
47 if (!libraryRoot.path.endsWith("/")) { | 48 if (!libraryRoot.path.endsWith("/")) { |
48 throw new ArgumentError("libraryRoot must end with a /"); | 49 throw new ArgumentError("libraryRoot must end with a /"); |
49 } | 50 } |
50 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | 51 if (packageRoot != null && !packageRoot.path.endsWith("/")) { |
51 throw new ArgumentError("packageRoot must end with a /"); | 52 throw new ArgumentError("packageRoot must end with a /"); |
52 } | 53 } |
53 } | 54 } |
54 | 55 |
55 static List<String> getStrips(List<String> options) { | 56 static List<String> getStrips(List<String> options) { |
56 for (String option in options) { | 57 for (String option in options) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 handler(translateUri(span.uri, null), span.begin, span.end, | 185 handler(translateUri(span.uri, null), span.begin, span.end, |
185 message, kind); | 186 message, kind); |
186 } | 187 } |
187 } | 188 } |
188 | 189 |
189 bool get isMockCompilation { | 190 bool get isMockCompilation { |
190 return mockableLibraryUsed | 191 return mockableLibraryUsed |
191 && (options.indexOf('--allow-mock-compilation') != -1); | 192 && (options.indexOf('--allow-mock-compilation') != -1); |
192 } | 193 } |
193 } | 194 } |
OLD | NEW |