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

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, 2 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 | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/dart_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart2js.dart
diff --git a/lib/compiler/implementation/dart2js.dart b/lib/compiler/implementation/dart2js.dart
index 73d397bdf7fcf9834d1f5943340cbd9d16cd7238..55e24a6054394a66a8ba7835ca61f80a4762c24d 100644
--- a/lib/compiler/implementation/dart2js.dart
+++ b/lib/compiler/implementation/dart2js.dart
@@ -15,6 +15,7 @@
#import('util/uri_extras.dart');
const String LIBRARY_ROOT = '../../../..';
+const String OUTPUT_LANGUAGE_DART = 'Dart';
typedef void HandleOption(String option);
@@ -79,6 +80,7 @@ void compile(List<String> argv) {
bool wantHelp = false;
bool enableColors = false;
String outputLanguage = 'JavaScript';
+ bool stripArgumentSet = false;
passThrough(String argument) => options.add(argument);
@@ -98,7 +100,7 @@ void compile(List<String> argv) {
setOutputType(String argument) {
if (argument == '--output-type=dart') {
- outputLanguage = 'Dart';
+ outputLanguage = OUTPUT_LANGUAGE_DART;
if (!explicitOut) {
out = cwd.resolve('out.dart');
sourceMapOut = cwd.resolve('out.dart.map');
@@ -107,6 +109,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 +145,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 +163,12 @@ void compile(List<String> argv) {
];
parseCommandLine(handlers, argv);
-
if (wantHelp) helpAndExit(verbose);
+ if (outputLanguage != OUTPUT_LANGUAGE_DART && stripArgumentSet) {
+ helpAndFail('Error: --force-strip may only be used with '
+ '--output-type=dart');
+ }
if (arguments.isEmpty()) {
helpAndFail('Error: No Dart file specified.');
}
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698