Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/apiimpl.dart

Issue 12431009: Add --analyze-signatures-only option to dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 26 matching lines...) Expand all
37 outputProvider: outputProvider, 37 outputProvider: outputProvider,
38 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), 38 enableTypeAssertions: hasOption(options, '--enable-checked-mode'),
39 enableUserAssertions: hasOption(options, '--enable-checked-mode'), 39 enableUserAssertions: hasOption(options, '--enable-checked-mode'),
40 enableMinification: hasOption(options, '--minify'), 40 enableMinification: hasOption(options, '--minify'),
41 enableNativeLiveTypeAnalysis: 41 enableNativeLiveTypeAnalysis:
42 !hasOption(options, '--disable-native-live-type-analysis'), 42 !hasOption(options, '--disable-native-live-type-analysis'),
43 emitJavaScript: !hasOption(options, '--output-type=dart'), 43 emitJavaScript: !hasOption(options, '--output-type=dart'),
44 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), 44 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'),
45 analyzeAll: hasOption(options, '--analyze-all'), 45 analyzeAll: hasOption(options, '--analyze-all'),
46 analyzeOnly: hasOption(options, '--analyze-only'), 46 analyzeOnly: hasOption(options, '--analyze-only'),
47 analyzeSignaturesOnly:
48 hasOption(options, '--analyze-signatures-only'),
47 rejectDeprecatedFeatures: 49 rejectDeprecatedFeatures:
48 hasOption(options, '--reject-deprecated-language-features'), 50 hasOption(options, '--reject-deprecated-language-features'),
49 checkDeprecationInSdk: 51 checkDeprecationInSdk:
50 hasOption(options, 52 hasOption(options,
51 '--report-sdk-use-of-deprecated-language-features'), 53 '--report-sdk-use-of-deprecated-language-features'),
52 strips: getStrips(options), 54 strips: getStrips(options),
53 enableConcreteTypeInference: 55 enableConcreteTypeInference:
54 hasOption(options, '--enable-concrete-type-inference'), 56 hasOption(options, '--enable-concrete-type-inference'),
55 preserveComments: hasOption(options, '--preserve-comments')) { 57 preserveComments: hasOption(options, '--preserve-comments')) {
56 if (!libraryRoot.path.endsWith("/")) { 58 if (!libraryRoot.path.endsWith("/")) {
57 throw new ArgumentError("libraryRoot must end with a /"); 59 throw new ArgumentError("libraryRoot must end with a /");
58 } 60 }
59 if (packageRoot != null && !packageRoot.path.endsWith("/")) { 61 if (packageRoot != null && !packageRoot.path.endsWith("/")) {
60 throw new ArgumentError("packageRoot must end with a /"); 62 throw new ArgumentError("packageRoot must end with a /");
61 } 63 }
64 if (analyzeSignaturesOnly && !analyzeOnly) {
ahe 2013/03/05 14:32:59 How about --analyze-signatures-only implies --anal
Johnni Winther 2013/03/05 16:52:49 Done.
65 throw new ArgumentError("--analyze-signatures-only can only "
66 "be used together with --analyze-only");
67 }
62 } 68 }
63 69
64 static List<String> getStrips(List<String> options) { 70 static List<String> getStrips(List<String> options) {
65 for (String option in options) { 71 for (String option in options) {
66 if (option.startsWith('--force-strip=')) { 72 if (option.startsWith('--force-strip=')) {
67 return option.substring('--force-strip='.length).split(','); 73 return option.substring('--force-strip='.length).split(',');
68 } 74 }
69 } 75 }
70 return const <String>[]; 76 return const <String>[];
71 } 77 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 handler(translateUri(span.uri, null), span.begin, span.end, 263 handler(translateUri(span.uri, null), span.begin, span.end,
258 message, kind); 264 message, kind);
259 } 265 }
260 } 266 }
261 267
262 bool get isMockCompilation { 268 bool get isMockCompilation {
263 return mockableLibraryUsed 269 return mockableLibraryUsed
264 && (options.indexOf('--allow-mock-compilation') != -1); 270 && (options.indexOf('--allow-mock-compilation') != -1);
265 } 271 }
266 } 272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698