Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js; | 5 library dart2js; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 import 'dart:utf'; | 9 import 'dart:utf'; |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 (_) => enableColors = false), | 157 (_) => enableColors = false), |
| 158 new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true), | 158 new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true), |
| 159 new OptionHandler('--enable[_-]checked[_-]mode|--checked', | 159 new OptionHandler('--enable[_-]checked[_-]mode|--checked', |
| 160 (_) => passThrough('--enable-checked-mode')), | 160 (_) => passThrough('--enable-checked-mode')), |
| 161 new OptionHandler('--enable-concrete-type-inference', | 161 new OptionHandler('--enable-concrete-type-inference', |
| 162 (_) => passThrough('--enable-concrete-type-inference')), | 162 (_) => passThrough('--enable-concrete-type-inference')), |
| 163 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), | 163 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), |
| 164 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), | 164 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), |
| 165 new OptionHandler('--disallow-unsafe-eval', passThrough), | 165 new OptionHandler('--disallow-unsafe-eval', passThrough), |
| 166 new OptionHandler('--analyze-all', passThrough), | 166 new OptionHandler('--analyze-all', passThrough), |
| 167 new OptionHandler('--reject-deprecated-language-features', passThrough), | |
| 168 new OptionHandler('--report-sdk-use-of-deprecated-language-features', | |
| 169 passThrough), | |
| 170 | |
| 167 // The following two options must come last. | 171 // The following two options must come last. |
| 168 new OptionHandler('-.*', (String argument) { | 172 new OptionHandler('-.*', (String argument) { |
| 169 helpAndFail('Error: Unknown option "$argument".'); | 173 helpAndFail('Error: Unknown option "$argument".'); |
| 170 }), | 174 }), |
| 171 new OptionHandler('.*', (String argument) { | 175 new OptionHandler('.*', (String argument) { |
| 172 arguments.add(nativeToUriPath(argument)); | 176 arguments.add(nativeToUriPath(argument)); |
| 173 }) | 177 }) |
| 174 ]; | 178 ]; |
| 175 | 179 |
| 176 parseCommandLine(handlers, argv); | 180 parseCommandLine(handlers, argv); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 Do not generate a call to main if either of the following | 410 Do not generate a call to main if either of the following |
| 407 libraries are used: dart:dom, dart:html dart:io. | 411 libraries are used: dart:dom, dart:html dart:io. |
| 408 | 412 |
| 409 --enable-concrete-type-inference | 413 --enable-concrete-type-inference |
| 410 Enable experimental concrete type inference. | 414 Enable experimental concrete type inference. |
| 411 | 415 |
| 412 --disallow-unsafe-eval | 416 --disallow-unsafe-eval |
| 413 Disables dynamic generation of code in the generated output. This is | 417 Disables dynamic generation of code in the generated output. This is |
| 414 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). | 418 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). |
| 415 This flag is not continuously tested. Please report breakages and we | 419 This flag is not continuously tested. Please report breakages and we |
| 416 will fix them as soon as possible.'''); | 420 will fix them as soon as possible. |
| 421 | |
| 422 --reject-deprecated-language-features | |
| 423 Reject deprecated language features. Without this option, the | |
| 424 compiler will accept language features that are no longer valid | |
| 425 according to The Dart Programming Language Specification, version | |
| 426 0.12, M1. | |
| 427 | |
| 428 --report-sdk-use-of-deprecated-language-features | |
| 429 Report use of deprecated features in Dart platform libraries. | |
| 430 Without this option, the compiler will silently accept use of | |
| 431 deprecated language features from these libraries. The option | |
| 432 --reject-deprecated-language-features controls if these usages are | |
| 433 reported as errors or warnings. | |
| 434 | |
|
karlklose
2012/11/15 10:17:26
Remove extra line?
ahe
2012/11/16 07:07:36
I added it on purpose, as I think it will make the
| |
| 435 '''.trim()); | |
| 417 } | 436 } |
| 418 | 437 |
| 419 void helpAndExit(bool verbose) { | 438 void helpAndExit(bool verbose) { |
| 420 if (verbose) { | 439 if (verbose) { |
| 421 verboseHelp(); | 440 verboseHelp(); |
| 422 } else { | 441 } else { |
| 423 help(); | 442 help(); |
| 424 } | 443 } |
| 425 exit(0); | 444 exit(0); |
| 426 } | 445 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 440 } catch (ignored) { | 459 } catch (ignored) { |
| 441 print('Internal error: error while printing exception'); | 460 print('Internal error: error while printing exception'); |
| 442 } | 461 } |
| 443 try { | 462 try { |
| 444 print(trace); | 463 print(trace); |
| 445 } finally { | 464 } finally { |
| 446 exit(253); // 253 is recognized as a crash by our test scripts. | 465 exit(253); // 253 is recognized as a crash by our test scripts. |
| 447 } | 466 } |
| 448 } | 467 } |
| 449 } | 468 } |
| OLD | NEW |