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 show exit, File, FileMode, Options, Platform, RandomAccessFile; | 9 show exit, File, FileMode, Options, Platform, RandomAccessFile; |
10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 new OptionHandler('--enable-diagnostic-colors', | 246 new OptionHandler('--enable-diagnostic-colors', |
247 (_) => diagnosticHandler.enableColors = true), | 247 (_) => diagnosticHandler.enableColors = true), |
248 new OptionHandler('--enable[_-]checked[_-]mode|--checked', | 248 new OptionHandler('--enable[_-]checked[_-]mode|--checked', |
249 (_) => passThrough('--enable-checked-mode')), | 249 (_) => passThrough('--enable-checked-mode')), |
250 new OptionHandler('--enable-concrete-type-inference', | 250 new OptionHandler('--enable-concrete-type-inference', |
251 (_) => passThrough('--enable-concrete-type-inference')), | 251 (_) => passThrough('--enable-concrete-type-inference')), |
252 new OptionHandler('--trust-type-annotations', | 252 new OptionHandler('--trust-type-annotations', |
253 (_) => passThrough('--trust-type-annotations')), | 253 (_) => passThrough('--trust-type-annotations')), |
254 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), | 254 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), |
255 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), | 255 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), |
256 new OptionHandler('--disallow-unsafe-eval', passThrough), | |
257 new OptionHandler('--analyze-all', passThrough), | 256 new OptionHandler('--analyze-all', passThrough), |
258 new OptionHandler('--analyze-only', setAnalyzeOnly), | 257 new OptionHandler('--analyze-only', setAnalyzeOnly), |
259 new OptionHandler('--analyze-signatures-only', passThrough), | 258 new OptionHandler('--analyze-signatures-only', passThrough), |
260 new OptionHandler('--disable-native-live-type-analysis', passThrough), | 259 new OptionHandler('--disable-native-live-type-analysis', passThrough), |
261 new OptionHandler('--categories=.*', setCategories), | 260 new OptionHandler('--categories=.*', setCategories), |
262 new OptionHandler('--global-js-name=.*', checkGlobalName), | 261 new OptionHandler('--global-js-name=.*', checkGlobalName), |
263 new OptionHandler('--disable-type-inference', passThrough), | 262 new OptionHandler('--disable-type-inference', passThrough), |
264 new OptionHandler('--terse', passThrough), | 263 new OptionHandler('--terse', passThrough), |
265 | 264 |
266 // The following two options must come last. | 265 // The following two options must come last. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 --analyze-only | 477 --analyze-only |
479 Analyze but do not generate code. | 478 Analyze but do not generate code. |
480 | 479 |
481 --analyze-signatures-only | 480 --analyze-signatures-only |
482 Skip analysis of method bodies and field initializers. This option implies | 481 Skip analysis of method bodies and field initializers. This option implies |
483 --analyze-only. | 482 --analyze-only. |
484 | 483 |
485 --minify | 484 --minify |
486 Generate minified output. | 485 Generate minified output. |
487 | 486 |
488 --disallow-unsafe-eval | |
489 Disable dynamic generation of code in the generated output. This is | |
490 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). | |
491 | |
492 --suppress-warnings | 487 --suppress-warnings |
493 Do not display any warnings. | 488 Do not display any warnings. |
494 | 489 |
495 --suppress-hints | 490 --suppress-hints |
496 Do not display any hints. | 491 Do not display any hints. |
497 | 492 |
498 --enable-diagnostic-colors | 493 --enable-diagnostic-colors |
499 Add colors to diagnostic messages. | 494 Add colors to diagnostic messages. |
500 | 495 |
501 --terse | 496 --terse |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 } | 572 } |
578 } finally { | 573 } finally { |
579 exit(253); // 253 is recognized as a crash by our test scripts. | 574 exit(253); // 253 is recognized as a crash by our test scripts. |
580 } | 575 } |
581 }); | 576 }); |
582 } | 577 } |
583 | 578 |
584 void main() { | 579 void main() { |
585 mainWithErrorHandler(new Options()); | 580 mainWithErrorHandler(new Options()); |
586 } | 581 } |
OLD | NEW |