| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.cmdline; | 5 library dart2js.cmdline; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:math' as math; | 9 import 'dart:math' as math; |
| 10 | 10 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 (_) => passThrough('--enable-concrete-type-inference')), | 249 (_) => passThrough('--enable-concrete-type-inference')), |
| 250 new OptionHandler('--trust-type-annotations', | 250 new OptionHandler('--trust-type-annotations', |
| 251 (_) => passThrough('--trust-type-annotations')), | 251 (_) => passThrough('--trust-type-annotations')), |
| 252 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), | 252 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), |
| 253 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), | 253 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), |
| 254 new OptionHandler('--disallow-unsafe-eval', passThrough), | 254 new OptionHandler('--disallow-unsafe-eval', passThrough), |
| 255 new OptionHandler('--analyze-all', passThrough), | 255 new OptionHandler('--analyze-all', passThrough), |
| 256 new OptionHandler('--analyze-only', setAnalyzeOnly), | 256 new OptionHandler('--analyze-only', setAnalyzeOnly), |
| 257 new OptionHandler('--analyze-signatures-only', passThrough), | 257 new OptionHandler('--analyze-signatures-only', passThrough), |
| 258 new OptionHandler('--disable-native-live-type-analysis', passThrough), | 258 new OptionHandler('--disable-native-live-type-analysis', passThrough), |
| 259 new OptionHandler('--reject-deprecated-language-features', passThrough), | |
| 260 new OptionHandler('--report-sdk-use-of-deprecated-language-features', | |
| 261 passThrough), | |
| 262 new OptionHandler('--categories=.*', setCategories), | 259 new OptionHandler('--categories=.*', setCategories), |
| 263 new OptionHandler('--global-js-name=.*', checkGlobalName), | 260 new OptionHandler('--global-js-name=.*', checkGlobalName), |
| 264 new OptionHandler('--disable-type-inference', passThrough), | 261 new OptionHandler('--disable-type-inference', passThrough), |
| 265 | 262 |
| 266 // The following two options must come last. | 263 // The following two options must come last. |
| 267 new OptionHandler('-.*', (String argument) { | 264 new OptionHandler('-.*', (String argument) { |
| 268 helpAndFail('Error: Unknown option "$argument".'); | 265 helpAndFail('Error: Unknown option "$argument".'); |
| 269 }), | 266 }), |
| 270 new OptionHandler('.*', (String argument) { | 267 new OptionHandler('.*', (String argument) { |
| 271 arguments.add(nativeToUriPath(argument)); | 268 arguments.add(nativeToUriPath(argument)); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 Do not generate a call to main if either of the following | 516 Do not generate a call to main if either of the following |
| 520 libraries are used: dart:dom, dart:html dart:io. | 517 libraries are used: dart:dom, dart:html dart:io. |
| 521 | 518 |
| 522 --enable-concrete-type-inference | 519 --enable-concrete-type-inference |
| 523 Enable experimental concrete type inference. | 520 Enable experimental concrete type inference. |
| 524 | 521 |
| 525 --disable-native-live-type-analysis | 522 --disable-native-live-type-analysis |
| 526 Disable the optimization that removes unused native types from dart:html | 523 Disable the optimization that removes unused native types from dart:html |
| 527 and related libraries. | 524 and related libraries. |
| 528 | 525 |
| 529 --reject-deprecated-language-features | |
| 530 Reject deprecated language features. Without this option, the | |
| 531 compiler will accept language features that are no longer valid | |
| 532 according to The Dart Programming Language Specification, version | |
| 533 0.12, M1. | |
| 534 | |
| 535 --report-sdk-use-of-deprecated-language-features | |
| 536 Report use of deprecated features in Dart platform libraries. | |
| 537 Without this option, the compiler will silently accept use of | |
| 538 deprecated language features from these libraries. The option | |
| 539 --reject-deprecated-language-features controls if these usages are | |
| 540 reported as errors or warnings. | |
| 541 | |
| 542 --categories=<categories> | 526 --categories=<categories> |
| 543 A comma separated list of allowed library categories. The default | 527 A comma separated list of allowed library categories. The default |
| 544 is "Client". Possible categories can be seen by providing an | 528 is "Client". Possible categories can be seen by providing an |
| 545 unsupported category, for example, --categories=help. To enable | 529 unsupported category, for example, --categories=help. To enable |
| 546 all categories, use --categories=all. | 530 all categories, use --categories=all. |
| 547 | 531 |
| 548 --global-js-name=<name> | 532 --global-js-name=<name> |
| 549 By default, dart2js generates JavaScript output that uses a global | 533 By default, dart2js generates JavaScript output that uses a global |
| 550 variable named "$". The name of this global can be overridden | 534 variable named "$". The name of this global can be overridden |
| 551 with this option. The name must match the regular expression "\$[a-z]*". | 535 with this option. The name must match the regular expression "\$[a-z]*". |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 print(trace); | 573 print(trace); |
| 590 } finally { | 574 } finally { |
| 591 exit(253); // 253 is recognized as a crash by our test scripts. | 575 exit(253); // 253 is recognized as a crash by our test scripts. |
| 592 } | 576 } |
| 593 } | 577 } |
| 594 } | 578 } |
| 595 | 579 |
| 596 void main() { | 580 void main() { |
| 597 mainWithErrorHandler(new Options()); | 581 mainWithErrorHandler(new Options()); |
| 598 } | 582 } |
| OLD | NEW |