Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 List<String> options) | 26 List<String> options) |
| 27 : this.options = options, | 27 : this.options = options, |
| 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 emitJavaScript: !hasOption(options, '--output-type=dart'), | 33 emitJavaScript: !hasOption(options, '--output-type=dart'), |
| 34 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), | 34 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), |
| 35 analyzeAll: hasOption(options, '--analyze-all'), | 35 analyzeAll: hasOption(options, '--analyze-all'), |
| 36 rejectDeprecatedFeatures: | |
| 37 hasOption(options, '--reject-deprecated-language-features'), | |
| 38 omgThisIsALongOptionName: | |
|
karlklose
2012/11/15 10:17:26
omg, this is a nice option name!
ahe
2012/11/16 07:07:36
Yeah, the guy that came up with this is pretty cle
| |
| 39 hasOption(options, | |
| 40 '--report-sdk-use-of-deprecated-language-features'), | |
| 36 strips: getStrips(options), | 41 strips: getStrips(options), |
| 37 enableConcreteTypeInference: | 42 enableConcreteTypeInference: |
| 38 hasOption(options, '--enable-concrete-type-inference')) { | 43 hasOption(options, '--enable-concrete-type-inference')) { |
| 39 if (!libraryRoot.path.endsWith("/")) { | 44 if (!libraryRoot.path.endsWith("/")) { |
| 40 throw new ArgumentError("libraryRoot must end with a /"); | 45 throw new ArgumentError("libraryRoot must end with a /"); |
| 41 } | 46 } |
| 42 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | 47 if (packageRoot != null && !packageRoot.path.endsWith("/")) { |
| 43 throw new ArgumentError("packageRoot must end with a /"); | 48 throw new ArgumentError("packageRoot must end with a /"); |
| 44 } | 49 } |
| 45 } | 50 } |
| 46 | 51 |
| 47 static List<String> getStrips(List<String> options) { | 52 static List<String> getStrips(List<String> options) { |
| 48 for (String option in options) { | 53 for (String option in options) { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 handler(translateUri(span.uri, null), span.begin, span.end, | 174 handler(translateUri(span.uri, null), span.begin, span.end, |
| 170 message, kind); | 175 message, kind); |
| 171 } | 176 } |
| 172 } | 177 } |
| 173 | 178 |
| 174 bool get isMockCompilation { | 179 bool get isMockCompilation { |
| 175 return mockableLibraryUsed | 180 return mockableLibraryUsed |
| 176 && (options.indexOf('--allow-mock-compilation') != -1); | 181 && (options.indexOf('--allow-mock-compilation') != -1); |
| 177 } | 182 } |
| 178 } | 183 } |
| OLD | NEW |