| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 --disable-native-live-type-analysis | 593 --disable-native-live-type-analysis |
| 593 Disable the optimization that removes unused native types from dart:html | 594 Disable the optimization that removes unused native types from dart:html |
| 594 and related libraries. | 595 and related libraries. |
| 595 | 596 |
| 596 --categories=<categories> | 597 --categories=<categories> |
| 597 A comma separated list of allowed library categories. The default | 598 A comma separated list of allowed library categories. The default |
| 598 is "Client". Possible categories can be seen by providing an | 599 is "Client". Possible categories can be seen by providing an |
| 599 unsupported category, for example, --categories=help. To enable | 600 unsupported category, for example, --categories=help. To enable |
| 600 all categories, use --categories=all. | 601 all categories, use --categories=all. |
| 601 | 602 |
| 603 --deferred-map=<file> |
| 604 Generates a json file with a mapping from each deferred import to a list of |
| 605 the part.js files that will be loaded. |
| 606 |
| 602 --dump-info | 607 --dump-info |
| 603 Generates an out.info.json file with information about the generated code. | 608 Generates an out.info.json file with information about the generated code. |
| 604 You can inspect the generated file with the viewer at: | 609 You can inspect the generated file with the viewer at: |
| 605 https://dart-lang.github.io/dump-info-visualizer/ | 610 https://dart-lang.github.io/dump-info-visualizer/ |
| 606 | 611 |
| 607 '''.trim()); | 612 '''.trim()); |
| 608 } | 613 } |
| 609 | 614 |
| 610 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { | 615 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { |
| 611 if (wantVersion) { | 616 if (wantVersion) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } else if (exitCode == 253) { | 709 } else if (exitCode == 253) { |
| 705 print(">>> TEST CRASH"); | 710 print(">>> TEST CRASH"); |
| 706 } else { | 711 } else { |
| 707 print(">>> TEST FAIL"); | 712 print(">>> TEST FAIL"); |
| 708 } | 713 } |
| 709 stderr.writeln(">>> EOF STDERR"); | 714 stderr.writeln(">>> EOF STDERR"); |
| 710 subscription.resume(); | 715 subscription.resume(); |
| 711 }); | 716 }); |
| 712 }); | 717 }); |
| 713 } | 718 } |
| OLD | NEW |