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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 (_) => enableColors = false), | 157 (_) => enableColors = false), |
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 // The following two options must come last. | 168 // The following two options must come last. |
168 new OptionHandler('-.*', (String argument) { | 169 new OptionHandler('-.*', (String argument) { |
169 helpAndFail('Error: Unknown option "$argument".'); | 170 helpAndFail('Error: Unknown option "$argument".'); |
170 }), | 171 }), |
171 new OptionHandler('.*', (String argument) { | 172 new OptionHandler('.*', (String argument) { |
172 arguments.add(nativeToUriPath(argument)); | 173 arguments.add(nativeToUriPath(argument)); |
173 }) | 174 }) |
174 ]; | 175 ]; |
175 | 176 |
176 parseCommandLine(handlers, argv); | 177 parseCommandLine(handlers, argv); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 --library-root=<directory> | 403 --library-root=<directory> |
403 Where to find the Dart platform libraries. | 404 Where to find the Dart platform libraries. |
404 | 405 |
405 --allow-mock-compilation | 406 --allow-mock-compilation |
406 Do not generate a call to main if either of the following | 407 Do not generate a call to main if either of the following |
407 libraries are used: dart:dom, dart:html dart:io. | 408 libraries are used: dart:dom, dart:html dart:io. |
408 | 409 |
409 --enable-concrete-type-inference | 410 --enable-concrete-type-inference |
410 Enable experimental concrete type inference. | 411 Enable experimental concrete type inference. |
411 | 412 |
| 413 --enable-native-live-type-analysis |
| 414 Remove unused native types from dart:html and related libraries. This is |
| 415 expected to become the default behavior. |
| 416 |
412 --disallow-unsafe-eval | 417 --disallow-unsafe-eval |
413 Disables dynamic generation of code in the generated output. This is | 418 Disables dynamic generation of code in the generated output. This is |
414 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). | 419 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). |
415 This flag is not continuously tested. Please report breakages and we | 420 This flag is not continuously tested. Please report breakages and we |
416 will fix them as soon as possible.'''); | 421 will fix them as soon as possible.'''); |
417 } | 422 } |
418 | 423 |
419 void helpAndExit(bool verbose) { | 424 void helpAndExit(bool verbose) { |
420 if (verbose) { | 425 if (verbose) { |
421 verboseHelp(); | 426 verboseHelp(); |
(...skipping 18 matching lines...) Expand all Loading... |
440 } catch (ignored) { | 445 } catch (ignored) { |
441 print('Internal error: error while printing exception'); | 446 print('Internal error: error while printing exception'); |
442 } | 447 } |
443 try { | 448 try { |
444 print(trace); | 449 print(trace); |
445 } finally { | 450 } finally { |
446 exit(253); // 253 is recognized as a crash by our test scripts. | 451 exit(253); // 253 is recognized as a crash by our test scripts. |
447 } | 452 } |
448 } | 453 } |
449 } | 454 } |
OLD | NEW |