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

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

Issue 10963055: [dart2dart] Make removal of asserts and forcing type strips go under (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: lib/compiler/implementation/dart2js.dart
diff --git a/lib/compiler/implementation/dart2js.dart b/lib/compiler/implementation/dart2js.dart
index 73d397bdf7fcf9834d1f5943340cbd9d16cd7238..eb355f150bd939066ae37de2a98da36276bd24b2 100644
--- a/lib/compiler/implementation/dart2js.dart
+++ b/lib/compiler/implementation/dart2js.dart
@@ -79,6 +79,7 @@ void compile(List<String> argv) {
bool wantHelp = false;
bool enableColors = false;
String outputLanguage = 'JavaScript';
+ bool stripArgumentSet = false;
passThrough(String argument) => options.add(argument);
@@ -107,6 +108,11 @@ void compile(List<String> argv) {
passThrough(argument);
}
+ setStrip(String argument) {
+ stripArgumentSet = true;
+ passThrough(argument);
+ }
+
handleShortOptions(String argument) {
var shortOptions = argument.substring(1).splitChars();
for (var shortOption in shortOptions) {
@@ -138,7 +144,7 @@ void compile(List<String> argv) {
new OptionHandler('--out=.+|-o.+', setOutput),
new OptionHandler('--allow-mock-compilation', passThrough),
new OptionHandler('--minify', passThrough),
- new OptionHandler('--force-cut-declaration-types', passThrough),
+ new OptionHandler('--force-strip=.*', setStrip),
// TODO(ahe): Remove the --no-colors option.
new OptionHandler('--disable-diagnostic-colors', (_) => enableColors = false),
new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true),
@@ -156,9 +162,12 @@ void compile(List<String> argv) {
];
parseCommandLine(handlers, argv);
-
if (wantHelp) helpAndExit(verbose);
+ if (outputLanguage != 'Dart' && stripArgumentSet) {
ahe 2012/10/01 10:19:22 I like this check!
+ helpAndFail('Error: --force-strip may only be used with '
+ '--output-type=dart');
+ }
if (arguments.isEmpty()) {
helpAndFail('Error: No Dart file specified.');
}

Powered by Google App Engine
This is Rietveld 408576698