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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart2js.dart

Issue 11882017: Add --analyze-only flag to dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add analyze_only_test Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/dart2js.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js.dart b/sdk/lib/_internal/compiler/implementation/dart2js.dart
index f5acd283306f73b1fd1d34fd6095bf72b6998b7c..dbe89b3a327185b655cd26b5d98cecec61159e3d 100644
--- a/sdk/lib/_internal/compiler/implementation/dart2js.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart2js.dart
@@ -79,6 +79,7 @@ void compile(List<String> argv) {
bool wantHelp = false;
String outputLanguage = 'JavaScript';
bool stripArgumentSet = false;
+ bool analyzeOnly = false;
SourceFileProvider inputProvider = new SourceFileProvider();
FormattingDiagnosticHandler diagnosticHandler =
new FormattingDiagnosticHandler(inputProvider);
@@ -121,6 +122,11 @@ void compile(List<String> argv) {
passThrough(argument);
}
+ setAnalyzeOnly(String argument) {
+ analyzeOnly = true;
+ passThrough(argument);
+ }
+
handleShortOptions(String argument) {
var shortOptions = argument.substring(1).splitChars();
for (var shortOption in shortOptions) {
@@ -168,6 +174,7 @@ void compile(List<String> argv) {
new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
new OptionHandler('--disallow-unsafe-eval', passThrough),
new OptionHandler('--analyze-all', passThrough),
+ new OptionHandler('--analyze-only', setAnalyzeOnly),
new OptionHandler('--disable-native-live-type-analysis', passThrough),
new OptionHandler('--enable-native-live-type-analysis', passThrough),
new OptionHandler('--reject-deprecated-language-features', passThrough),
@@ -223,6 +230,8 @@ void compile(List<String> argv) {
inputProvider.readStringFromUri,
handler,
options));
+ if (analyzeOnly) return;
+
if (code == null) {
fail('Error: Compilation failed.');
}
@@ -315,6 +324,9 @@ Supported options:
finding errors in libraries, but using it can result in bigger and
slower output.
+ --analyze-only
+ Analyze but do not generate code.
+
--minify
Generate minified output.

Powered by Google App Engine
This is Rietveld 408576698