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

Unified Diff: pkg/kernel/bin/dartk.dart

Issue 2669783002: Put tree-shaking behind a flag in dartk. (Closed)
Patch Set: Make named argument TargetFlags.treeShake default to false Created 3 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
« no previous file with comments | « no previous file | pkg/kernel/lib/target/targets.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/bin/dartk.dart
diff --git a/pkg/kernel/bin/dartk.dart b/pkg/kernel/bin/dartk.dart
index b8666a43c45b26b7c20d994cfb14075b23e8981e..5a9ab99c39033048d541a19e7a33123646e81df7 100755
--- a/pkg/kernel/bin/dartk.dart
+++ b/pkg/kernel/bin/dartk.dart
@@ -77,7 +77,9 @@ ArgParser parser = new ArgParser(allowTrailingOptions: true)
help: 'When printing a library as text, also print its dependencies\n'
'on external libraries.')
..addFlag('show-offsets',
- help: 'When printing a library as text, also print node offsets');
+ help: 'When printing a library as text, also print node offsets')
+ ..addFlag('tree-shake',
+ defaultsTo: false, help: 'Enable tree-shaking if the target supports it');
String getUsage() => """
Usage: dartk [options] FILE
@@ -288,7 +290,8 @@ Future<CompilerOutcome> batchMain(
List<String> loadedFiles;
Function getLoadedFiles;
List errors = const [];
- TargetFlags targetFlags = new TargetFlags(strongMode: options['strong']);
+ TargetFlags targetFlags = new TargetFlags(
+ strongMode: options['strong'], treeShake: options['tree-shake']);
Target target = getTarget(options['target'], targetFlags);
var declaredVariables = <String, String>{};
@@ -400,5 +403,9 @@ Future<CompilerOutcome> batchMain(
print('writer.flush_time = $flushTime ms');
}
+ if (options['tolerant']) {
+ return CompilerOutcome.Ok;
+ }
+
return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok;
}
« no previous file with comments | « no previous file | pkg/kernel/lib/target/targets.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698