| 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 show Future, EventSink; | 8 show Future, EventSink; |
| 9 import 'dart:convert' show UTF8, LineSplitter; | 9 import 'dart:convert' show UTF8, LineSplitter; |
| 10 import 'dart:io' | 10 import 'dart:io' |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 '--trust-primitives')), | 326 '--trust-primitives')), |
| 327 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), | 327 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), |
| 328 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), | 328 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), |
| 329 new OptionHandler('--analyze-all', setAnalyzeAll), | 329 new OptionHandler('--analyze-all', setAnalyzeAll), |
| 330 new OptionHandler('--analyze-only', setAnalyzeOnly), | 330 new OptionHandler('--analyze-only', setAnalyzeOnly), |
| 331 new OptionHandler('--analyze-signatures-only', setAnalyzeOnly), | 331 new OptionHandler('--analyze-signatures-only', setAnalyzeOnly), |
| 332 new OptionHandler('--disable-native-live-type-analysis', passThrough), | 332 new OptionHandler('--disable-native-live-type-analysis', passThrough), |
| 333 new OptionHandler('--categories=.*', setCategories), | 333 new OptionHandler('--categories=.*', setCategories), |
| 334 new OptionHandler('--disable-type-inference', implyCompilation), | 334 new OptionHandler('--disable-type-inference', implyCompilation), |
| 335 new OptionHandler('--terse', passThrough), | 335 new OptionHandler('--terse', passThrough), |
| 336 new OptionHandler('--deferred-map=.+', implyCompilation), |
| 336 new OptionHandler('--dump-info', implyCompilation), | 337 new OptionHandler('--dump-info', implyCompilation), |
| 337 new OptionHandler('--disallow-unsafe-eval', | 338 new OptionHandler('--disallow-unsafe-eval', |
| 338 (_) => hasDisallowUnsafeEval = true), | 339 (_) => hasDisallowUnsafeEval = true), |
| 339 new OptionHandler('--show-package-warnings', passThrough), | 340 new OptionHandler('--show-package-warnings', passThrough), |
| 340 new OptionHandler('--csp', passThrough), | 341 new OptionHandler('--csp', passThrough), |
| 341 new OptionHandler('--enable-experimental-mirrors', passThrough), | 342 new OptionHandler('--enable-experimental-mirrors', passThrough), |
| 342 new OptionHandler('--enable-async', setEnableAsync), | 343 new OptionHandler('--enable-async', setEnableAsync), |
| 343 new OptionHandler('--enable-enum', passThrough), | 344 new OptionHandler('--enable-enum', passThrough), |
| 344 new OptionHandler('--allow-native-extensions', setAllowNativeExtensions), | 345 new OptionHandler('--allow-native-extensions', setAllowNativeExtensions), |
| 345 new OptionHandler('-D.+=.*', addInEnvironment), | 346 new OptionHandler('-D.+=.*', addInEnvironment), |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 --disable-native-live-type-analysis | 592 --disable-native-live-type-analysis |
| 592 Disable the optimization that removes unused native types from dart:html | 593 Disable the optimization that removes unused native types from dart:html |
| 593 and related libraries. | 594 and related libraries. |
| 594 | 595 |
| 595 --categories=<categories> | 596 --categories=<categories> |
| 596 A comma separated list of allowed library categories. The default | 597 A comma separated list of allowed library categories. The default |
| 597 is "Client". Possible categories can be seen by providing an | 598 is "Client". Possible categories can be seen by providing an |
| 598 unsupported category, for example, --categories=help. To enable | 599 unsupported category, for example, --categories=help. To enable |
| 599 all categories, use --categories=all. | 600 all categories, use --categories=all. |
| 600 | 601 |
| 602 --deferred-map=<file> |
| 603 Generates a json file with a mapping from each deferred import to a list of |
| 604 the part.js files that will be loaded. |
| 605 |
| 601 --dump-info | 606 --dump-info |
| 602 Generates an out.info.json file with information about the generated code. | 607 Generates an out.info.json file with information about the generated code. |
| 603 You can inspect the generated file with the viewer at: | 608 You can inspect the generated file with the viewer at: |
| 604 https://dart-lang.github.io/dump-info-visualizer/ | 609 https://dart-lang.github.io/dump-info-visualizer/ |
| 605 | 610 |
| 606 '''.trim()); | 611 '''.trim()); |
| 607 } | 612 } |
| 608 | 613 |
| 609 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { | 614 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { |
| 610 if (wantVersion) { | 615 if (wantVersion) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 } else if (exitCode == 253) { | 708 } else if (exitCode == 253) { |
| 704 print(">>> TEST CRASH"); | 709 print(">>> TEST CRASH"); |
| 705 } else { | 710 } else { |
| 706 print(">>> TEST FAIL"); | 711 print(">>> TEST FAIL"); |
| 707 } | 712 } |
| 708 stderr.writeln(">>> EOF STDERR"); | 713 stderr.writeln(">>> EOF STDERR"); |
| 709 subscription.resume(); | 714 subscription.resume(); |
| 710 }); | 715 }); |
| 711 }); | 716 }); |
| 712 } | 717 } |
| OLD | NEW |