| 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:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection' show Queue, LinkedHashMap; | 8 import 'dart:collection' show Queue, LinkedHashMap; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'dart:uri'; | 10 import 'dart:uri'; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 for (String category in categories) { | 144 for (String category in categories) { |
| 145 if (!allowedCategories.contains(category)) { | 145 if (!allowedCategories.contains(category)) { |
| 146 fail('Error: unsupported library category "$category", ' | 146 fail('Error: unsupported library category "$category", ' |
| 147 'supported categories are: $allowedCategoriesString'); | 147 'supported categories are: $allowedCategoriesString'); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 return passThrough('--categories=${categories.join(",")}'); | 151 return passThrough('--categories=${categories.join(",")}'); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // TODO(8522): Remove this method once option is restored. | |
| 155 complainAboutDisallowUnsafeEval(String argument) { | |
| 156 fail('Error: $argument is currently not supported, ' | |
| 157 'see http://dartbug.com/8522'); | |
| 158 } | |
| 159 | |
| 160 handleShortOptions(String argument) { | 154 handleShortOptions(String argument) { |
| 161 var shortOptions = argument.substring(1).split(""); | 155 var shortOptions = argument.substring(1).split(""); |
| 162 for (var shortOption in shortOptions) { | 156 for (var shortOption in shortOptions) { |
| 163 switch (shortOption) { | 157 switch (shortOption) { |
| 164 case 'v': | 158 case 'v': |
| 165 diagnosticHandler.verbose = true; | 159 diagnosticHandler.verbose = true; |
| 166 break; | 160 break; |
| 167 case 'h': | 161 case 'h': |
| 168 case '?': | 162 case '?': |
| 169 wantHelp = true; | 163 wantHelp = true; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 195 new OptionHandler('--disable-diagnostic-colors', | 189 new OptionHandler('--disable-diagnostic-colors', |
| 196 (_) => diagnosticHandler.enableColors = false), | 190 (_) => diagnosticHandler.enableColors = false), |
| 197 new OptionHandler('--enable-diagnostic-colors', | 191 new OptionHandler('--enable-diagnostic-colors', |
| 198 (_) => diagnosticHandler.enableColors = true), | 192 (_) => diagnosticHandler.enableColors = true), |
| 199 new OptionHandler('--enable[_-]checked[_-]mode|--checked', | 193 new OptionHandler('--enable[_-]checked[_-]mode|--checked', |
| 200 (_) => passThrough('--enable-checked-mode')), | 194 (_) => passThrough('--enable-checked-mode')), |
| 201 new OptionHandler('--enable-concrete-type-inference', | 195 new OptionHandler('--enable-concrete-type-inference', |
| 202 (_) => passThrough('--enable-concrete-type-inference')), | 196 (_) => passThrough('--enable-concrete-type-inference')), |
| 203 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), | 197 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), |
| 204 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), | 198 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), |
| 205 new OptionHandler('--disallow-unsafe-eval', | 199 new OptionHandler('--disallow-unsafe-eval', passThrough), |
| 206 complainAboutDisallowUnsafeEval), | |
| 207 new OptionHandler('--analyze-all', passThrough), | 200 new OptionHandler('--analyze-all', passThrough), |
| 208 new OptionHandler('--analyze-only', setAnalyzeOnly), | 201 new OptionHandler('--analyze-only', setAnalyzeOnly), |
| 209 new OptionHandler('--disable-native-live-type-analysis', passThrough), | 202 new OptionHandler('--disable-native-live-type-analysis', passThrough), |
| 210 new OptionHandler('--reject-deprecated-language-features', passThrough), | 203 new OptionHandler('--reject-deprecated-language-features', passThrough), |
| 211 new OptionHandler('--report-sdk-use-of-deprecated-language-features', | 204 new OptionHandler('--report-sdk-use-of-deprecated-language-features', |
| 212 passThrough), | 205 passThrough), |
| 213 new OptionHandler('--categories=.*', setCategories), | 206 new OptionHandler('--categories=.*', setCategories), |
| 214 | 207 |
| 215 // The following two options must come last. | 208 // The following two options must come last. |
| 216 new OptionHandler('-.*', (String argument) { | 209 new OptionHandler('-.*', (String argument) { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 Do not generate a call to main if either of the following | 428 Do not generate a call to main if either of the following |
| 436 libraries are used: dart:dom, dart:html dart:io. | 429 libraries are used: dart:dom, dart:html dart:io. |
| 437 | 430 |
| 438 --enable-concrete-type-inference | 431 --enable-concrete-type-inference |
| 439 Enable experimental concrete type inference. | 432 Enable experimental concrete type inference. |
| 440 | 433 |
| 441 --disable-native-live-type-analysis | 434 --disable-native-live-type-analysis |
| 442 Disable the optimization that removes unused native types from dart:html | 435 Disable the optimization that removes unused native types from dart:html |
| 443 and related libraries. | 436 and related libraries. |
| 444 | 437 |
| 445 ''' | |
| 446 /* TODO(8522): Restore this comment once option is restored. | |
| 447 ''' | |
| 448 --disallow-unsafe-eval | 438 --disallow-unsafe-eval |
| 449 Disable dynamic generation of code in the generated output. This is | 439 Disable dynamic generation of code in the generated output. This is |
| 450 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). | 440 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). |
| 451 This flag is not continuously tested. Please report breakages and we | 441 This flag is not continuously tested. Please report breakages and we |
| 452 will fix them as soon as possible. | 442 will fix them as soon as possible. |
| 453 | 443 |
| 454 ''' | |
| 455 */ | |
| 456 ''' | |
| 457 --reject-deprecated-language-features | 444 --reject-deprecated-language-features |
| 458 Reject deprecated language features. Without this option, the | 445 Reject deprecated language features. Without this option, the |
| 459 compiler will accept language features that are no longer valid | 446 compiler will accept language features that are no longer valid |
| 460 according to The Dart Programming Language Specification, version | 447 according to The Dart Programming Language Specification, version |
| 461 0.12, M1. | 448 0.12, M1. |
| 462 | 449 |
| 463 --report-sdk-use-of-deprecated-language-features | 450 --report-sdk-use-of-deprecated-language-features |
| 464 Report use of deprecated features in Dart platform libraries. | 451 Report use of deprecated features in Dart platform libraries. |
| 465 Without this option, the compiler will silently accept use of | 452 Without this option, the compiler will silently accept use of |
| 466 deprecated language features from these libraries. The option | 453 deprecated language features from these libraries. The option |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 } catch (ignored) { | 488 } catch (ignored) { |
| 502 print('Internal error: error while printing exception'); | 489 print('Internal error: error while printing exception'); |
| 503 } | 490 } |
| 504 try { | 491 try { |
| 505 print(trace); | 492 print(trace); |
| 506 } finally { | 493 } finally { |
| 507 exit(253); // 253 is recognized as a crash by our test scripts. | 494 exit(253); // 253 is recognized as a crash by our test scripts. |
| 508 } | 495 } |
| 509 } | 496 } |
| 510 } | 497 } |
| OLD | NEW |