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 | 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 17 matching lines...) Expand all Loading... |
28 super( | 28 super( |
29 tracer: new ssa.HTracer(), | 29 tracer: new ssa.HTracer(), |
30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), | 30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), |
31 enableUserAssertions: hasOption(options, '--enable-checked-mode'), | 31 enableUserAssertions: hasOption(options, '--enable-checked-mode'), |
32 enableMinification: hasOption(options, '--minify'), | 32 enableMinification: hasOption(options, '--minify'), |
33 enableNativeLiveTypeAnalysis: | 33 enableNativeLiveTypeAnalysis: |
34 hasOption(options, '--enable-native-live-type-analysis'), | 34 hasOption(options, '--enable-native-live-type-analysis'), |
35 emitJavaScript: !hasOption(options, '--output-type=dart'), | 35 emitJavaScript: !hasOption(options, '--output-type=dart'), |
36 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), | 36 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), |
37 analyzeAll: hasOption(options, '--analyze-all'), | 37 analyzeAll: hasOption(options, '--analyze-all'), |
| 38 rejectDeprecatedFeatures: |
| 39 hasOption(options, '--reject-deprecated-language-features'), |
| 40 checkDeprecationInSdk: |
| 41 hasOption(options, |
| 42 '--report-sdk-use-of-deprecated-language-features'), |
38 strips: getStrips(options), | 43 strips: getStrips(options), |
39 enableConcreteTypeInference: | 44 enableConcreteTypeInference: |
40 hasOption(options, '--enable-concrete-type-inference')) { | 45 hasOption(options, '--enable-concrete-type-inference')) { |
41 if (!libraryRoot.path.endsWith("/")) { | 46 if (!libraryRoot.path.endsWith("/")) { |
42 throw new ArgumentError("libraryRoot must end with a /"); | 47 throw new ArgumentError("libraryRoot must end with a /"); |
43 } | 48 } |
44 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | 49 if (packageRoot != null && !packageRoot.path.endsWith("/")) { |
45 throw new ArgumentError("packageRoot must end with a /"); | 50 throw new ArgumentError("packageRoot must end with a /"); |
46 } | 51 } |
47 } | 52 } |
48 | 53 |
49 static List<String> getStrips(List<String> options) { | 54 static List<String> getStrips(List<String> options) { |
50 for (String option in options) { | 55 for (String option in options) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 handler(translateUri(span.uri, null), span.begin, span.end, | 176 handler(translateUri(span.uri, null), span.begin, span.end, |
172 message, kind); | 177 message, kind); |
173 } | 178 } |
174 } | 179 } |
175 | 180 |
176 bool get isMockCompilation { | 181 bool get isMockCompilation { |
177 return mockableLibraryUsed | 182 return mockableLibraryUsed |
178 && (options.indexOf('--allow-mock-compilation') != -1); | 183 && (options.indexOf('--allow-mock-compilation') != -1); |
179 } | 184 } |
180 } | 185 } |
OLD | NEW |