| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 List<String> arguments = <String>[]; | 84 List<String> arguments = <String>[]; |
| 85 List<OptionHandler> handlers = <OptionHandler>[ | 85 List<OptionHandler> handlers = <OptionHandler>[ |
| 86 new OptionHandler('--throw-on-error', (_) => throwOnError = true), | 86 new OptionHandler('--throw-on-error', (_) => throwOnError = true), |
| 87 new OptionHandler('--suppress-warnings', (_) => showWarnings = false), | 87 new OptionHandler('--suppress-warnings', (_) => showWarnings = false), |
| 88 new OptionHandler('--output-type=dart|--output-type=js', passThrough), | 88 new OptionHandler('--output-type=dart|--output-type=js', passThrough), |
| 89 new OptionHandler('--verbose|-v', (_) => verbose = true), | 89 new OptionHandler('--verbose|-v', (_) => verbose = true), |
| 90 new OptionHandler('--library-root=.+', setLibraryRoot), | 90 new OptionHandler('--library-root=.+', setLibraryRoot), |
| 91 new OptionHandler('--out=.+|-o.+', setOutput), | 91 new OptionHandler('--out=.+|-o.+', setOutput), |
| 92 new OptionHandler('--allow-mock-compilation', passThrough), | 92 new OptionHandler('--allow-mock-compilation', passThrough), |
| 93 new OptionHandler('--unparse-validation', passThrough), |
| 93 new OptionHandler('--no-colors', (_) => colors.enabled = false), | 94 new OptionHandler('--no-colors', (_) => colors.enabled = false), |
| 94 new OptionHandler('--enable[_-]checked[_-]mode|--checked|-c', | 95 new OptionHandler('--enable[_-]checked[_-]mode|--checked|-c', |
| 95 (_) => passThrough('--enable-checked-mode')), | 96 (_) => passThrough('--enable-checked-mode')), |
| 96 new OptionHandler(@'--help|-h|/\?|/h', (_) => wantHelp = true), | 97 new OptionHandler(@'--help|-h|/\?|/h', (_) => wantHelp = true), |
| 97 new OptionHandler(@'--package-root=.+|-p.+', setPackageRoot), | 98 new OptionHandler(@'--package-root=.+|-p.+', setPackageRoot), |
| 98 // The following two options must come last. | 99 // The following two options must come last. |
| 99 new OptionHandler('-.*', (String argument) { | 100 new OptionHandler('-.*', (String argument) { |
| 100 helpAndFail('Error: Unknown option "$argument".'); | 101 helpAndFail('Error: Unknown option "$argument".'); |
| 101 }), | 102 }), |
| 102 new OptionHandler('.*', (String argument) { | 103 new OptionHandler('.*', (String argument) { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } catch (var ignored) { | 309 } catch (var ignored) { |
| 309 print('Internal error: error while printing exception'); | 310 print('Internal error: error while printing exception'); |
| 310 } | 311 } |
| 311 try { | 312 try { |
| 312 print(trace); | 313 print(trace); |
| 313 } finally { | 314 } finally { |
| 314 exit(253); // 253 is recognized as a crash by our test scripts. | 315 exit(253); // 253 is recognized as a crash by our test scripts. |
| 315 } | 316 } |
| 316 } | 317 } |
| 317 } | 318 } |
| OLD | NEW |