Chromium Code Reviews| Index: lib/compiler/implementation/dart2js.dart |
| diff --git a/lib/compiler/implementation/dart2js.dart b/lib/compiler/implementation/dart2js.dart |
| index 4ea5b6698ca6fe0c56f4330527d5b462aef72bc5..492ac0eae9c7fb7c096887ec22d68cfe88157e97 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) { |
|
Anton Muhin
2012/09/24 13:09:19
maybe it's time to introduced a named constant for
Roman
2012/09/28 13:44:14
Wouldn't enums be too heavy for such a small local
Roman
2012/10/03 12:24:26
Added 'Dart' const.
|
| + helpAndFail('Error: --force-strip may only be used with ' |
| + '--output-type=dart'); |
| + } |
| if (arguments.isEmpty()) { |
| helpAndFail('Error: No Dart file specified.'); |
| } |