| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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('--enable-native-live-type-analysis', passThrough), | 167 new OptionHandler('--enable-native-live-type-analysis', passThrough), |
| 168 new OptionHandler('--reject-deprecated-language-features', passThrough), |
| 169 new OptionHandler('--report-sdk-use-of-deprecated-language-features', |
| 170 passThrough), |
| 171 |
| 168 // The following two options must come last. | 172 // The following two options must come last. |
| 169 new OptionHandler('-.*', (String argument) { | 173 new OptionHandler('-.*', (String argument) { |
| 170 helpAndFail('Error: Unknown option "$argument".'); | 174 helpAndFail('Error: Unknown option "$argument".'); |
| 171 }), | 175 }), |
| 172 new OptionHandler('.*', (String argument) { | 176 new OptionHandler('.*', (String argument) { |
| 173 arguments.add(nativeToUriPath(argument)); | 177 arguments.add(nativeToUriPath(argument)); |
| 174 }) | 178 }) |
| 175 ]; | 179 ]; |
| 176 | 180 |
| 177 parseCommandLine(handlers, argv); | 181 parseCommandLine(handlers, argv); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 Enable experimental concrete type inference. | 415 Enable experimental concrete type inference. |
| 412 | 416 |
| 413 --enable-native-live-type-analysis | 417 --enable-native-live-type-analysis |
| 414 Remove unused native types from dart:html and related libraries. This is | 418 Remove unused native types from dart:html and related libraries. This is |
| 415 expected to become the default behavior. | 419 expected to become the default behavior. |
| 416 | 420 |
| 417 --disallow-unsafe-eval | 421 --disallow-unsafe-eval |
| 418 Disables dynamic generation of code in the generated output. This is | 422 Disables dynamic generation of code in the generated output. This is |
| 419 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). | 423 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). |
| 420 This flag is not continuously tested. Please report breakages and we | 424 This flag is not continuously tested. Please report breakages and we |
| 421 will fix them as soon as possible.'''); | 425 will fix them as soon as possible. |
| 426 |
| 427 --reject-deprecated-language-features |
| 428 Reject deprecated language features. Without this option, the |
| 429 compiler will accept language features that are no longer valid |
| 430 according to The Dart Programming Language Specification, version |
| 431 0.12, M1. |
| 432 |
| 433 --report-sdk-use-of-deprecated-language-features |
| 434 Report use of deprecated features in Dart platform libraries. |
| 435 Without this option, the compiler will silently accept use of |
| 436 deprecated language features from these libraries. The option |
| 437 --reject-deprecated-language-features controls if these usages are |
| 438 reported as errors or warnings. |
| 439 |
| 440 '''.trim()); |
| 422 } | 441 } |
| 423 | 442 |
| 424 void helpAndExit(bool verbose) { | 443 void helpAndExit(bool verbose) { |
| 425 if (verbose) { | 444 if (verbose) { |
| 426 verboseHelp(); | 445 verboseHelp(); |
| 427 } else { | 446 } else { |
| 428 help(); | 447 help(); |
| 429 } | 448 } |
| 430 exit(0); | 449 exit(0); |
| 431 } | 450 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 445 } catch (ignored) { | 464 } catch (ignored) { |
| 446 print('Internal error: error while printing exception'); | 465 print('Internal error: error while printing exception'); |
| 447 } | 466 } |
| 448 try { | 467 try { |
| 449 print(trace); | 468 print(trace); |
| 450 } finally { | 469 } finally { |
| 451 exit(253); // 253 is recognized as a crash by our test scripts. | 470 exit(253); // 253 is recognized as a crash by our test scripts. |
| 452 } | 471 } |
| 453 } | 472 } |
| 454 } | 473 } |
| OLD | NEW |