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 16 matching lines...) Expand all Loading... | |
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 strips: getStrips(options), | 35 strips: getStrips(options), |
36 enableConcreteTypeInference: | 36 enableConcreteTypeInference: |
37 hasOption(options, '--enable-concrete-type-inference')); | 37 hasOption(options, '--enable-concrete-type-inference')) { |
38 if (!libraryRoot.path.endsWith("/")) { | |
39 throw new ArgumentError("Library URI must end with a /"); | |
ahe
2012/11/05 15:58:42
Library URI -> libraryRoot
Johnni Winther
2012/11/05 16:23:29
Done.
| |
40 } | |
41 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | |
42 throw new ArgumentError("Package URI must end with a /"); | |
ahe
2012/11/05 15:58:42
Package URI -> packageRoot
Johnni Winther
2012/11/05 16:23:29
Done.
| |
43 } | |
44 } | |
45 | |
38 | 46 |
39 static List<String> getStrips(List<String> options) { | 47 static List<String> getStrips(List<String> options) { |
40 for (String option in options) { | 48 for (String option in options) { |
41 if (option.startsWith('--force-strip=')) { | 49 if (option.startsWith('--force-strip=')) { |
42 return option.substring('--force-strip='.length).split(','); | 50 return option.substring('--force-strip='.length).split(','); |
43 } | 51 } |
44 } | 52 } |
45 return []; | 53 return []; |
46 } | 54 } |
47 | 55 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 handler(translateUri(span.uri, null), span.begin, span.end, | 169 handler(translateUri(span.uri, null), span.begin, span.end, |
162 message, kind); | 170 message, kind); |
163 } | 171 } |
164 } | 172 } |
165 | 173 |
166 bool get isMockCompilation { | 174 bool get isMockCompilation { |
167 return mockableLibraryUsed | 175 return mockableLibraryUsed |
168 && (options.indexOf('--allow-mock-compilation') != -1); | 176 && (options.indexOf('--allow-mock-compilation') != -1); |
169 } | 177 } |
170 } | 178 } |
OLD | NEW |