| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 new OptionHandler('--force-strip=.*', setStrip), | 148 new OptionHandler('--force-strip=.*', setStrip), |
| 149 // TODO(ahe): Remove the --no-colors option. | 149 // TODO(ahe): Remove the --no-colors option. |
| 150 new OptionHandler('--disable-diagnostic-colors', | 150 new OptionHandler('--disable-diagnostic-colors', |
| 151 (_) => enableColors = false), | 151 (_) => enableColors = false), |
| 152 new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true), | 152 new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true), |
| 153 new OptionHandler('--enable[_-]checked[_-]mode|--checked', | 153 new OptionHandler('--enable[_-]checked[_-]mode|--checked', |
| 154 (_) => passThrough('--enable-checked-mode')), | 154 (_) => passThrough('--enable-checked-mode')), |
| 155 new OptionHandler('--enable-concrete-type-inference', | 155 new OptionHandler('--enable-concrete-type-inference', |
| 156 (_) => passThrough('--enable-concrete-type-inference')), | 156 (_) => passThrough('--enable-concrete-type-inference')), |
| 157 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), | 157 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), |
| 158 new OptionHandler(r'--package-root=.+|-p.+', setPackageRoot), | 158 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), |
| 159 new OptionHandler('--enable-content-security-policy', passThrough), |
| 159 // The following two options must come last. | 160 // The following two options must come last. |
| 160 new OptionHandler('-.*', (String argument) { | 161 new OptionHandler('-.*', (String argument) { |
| 161 helpAndFail('Error: Unknown option "$argument".'); | 162 helpAndFail('Error: Unknown option "$argument".'); |
| 162 }), | 163 }), |
| 163 new OptionHandler('.*', (String argument) { | 164 new OptionHandler('.*', (String argument) { |
| 164 arguments.add(nativeToUriPath(argument)); | 165 arguments.add(nativeToUriPath(argument)); |
| 165 }) | 166 }) |
| 166 ]; | 167 ]; |
| 167 | 168 |
| 168 parseCommandLine(handlers, argv); | 169 parseCommandLine(handlers, argv); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 Throw an exception if a compile-time error is detected. | 386 Throw an exception if a compile-time error is detected. |
| 386 | 387 |
| 387 --library-root=<directory> | 388 --library-root=<directory> |
| 388 Where to find the Dart platform libraries. | 389 Where to find the Dart platform libraries. |
| 389 | 390 |
| 390 --allow-mock-compilation | 391 --allow-mock-compilation |
| 391 Do not generate a call to main if either of the following | 392 Do not generate a call to main if either of the following |
| 392 libraries are used: dart:dom, dart:html dart:io. | 393 libraries are used: dart:dom, dart:html dart:io. |
| 393 | 394 |
| 394 --enable-concrete-type-inference | 395 --enable-concrete-type-inference |
| 395 Enable experimental concrete type inference.'''); | 396 Enable experimental concrete type inference. |
| 397 |
| 398 --enable-content-security-policy |
| 399 Emit JavaScript code that satisfies the CSP restrictions. This flag is |
| 400 not continuously tested. Please report breakages and we will fix them |
| 401 as soon as possible.'''); |
| 396 } | 402 } |
| 397 | 403 |
| 398 void helpAndExit(bool verbose) { | 404 void helpAndExit(bool verbose) { |
| 399 if (verbose) { | 405 if (verbose) { |
| 400 verboseHelp(); | 406 verboseHelp(); |
| 401 } else { | 407 } else { |
| 402 help(); | 408 help(); |
| 403 } | 409 } |
| 404 exit(0); | 410 exit(0); |
| 405 } | 411 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 419 } catch (ignored) { | 425 } catch (ignored) { |
| 420 print('Internal error: error while printing exception'); | 426 print('Internal error: error while printing exception'); |
| 421 } | 427 } |
| 422 try { | 428 try { |
| 423 print(trace); | 429 print(trace); |
| 424 } finally { | 430 } finally { |
| 425 exit(253); // 253 is recognized as a crash by our test scripts. | 431 exit(253); // 253 is recognized as a crash by our test scripts. |
| 426 } | 432 } |
| 427 } | 433 } |
| 428 } | 434 } |
| OLD | NEW |