| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 if (wantHelp) helpAndExit(diagnosticHandler.verbose); | 224 if (wantHelp) helpAndExit(diagnosticHandler.verbose); |
| 225 | 225 |
| 226 if (outputLanguage != OUTPUT_LANGUAGE_DART && stripArgumentSet) { | 226 if (outputLanguage != OUTPUT_LANGUAGE_DART && stripArgumentSet) { |
| 227 helpAndFail('Error: --force-strip may only be used with ' | 227 helpAndFail('Error: --force-strip may only be used with ' |
| 228 '--output-type=dart'); | 228 '--output-type=dart'); |
| 229 } | 229 } |
| 230 if (arguments.isEmpty) { | 230 if (arguments.isEmpty) { |
| 231 helpAndFail('Error: No Dart file specified.'); | 231 helpAndFail('Error: No Dart file specified.'); |
| 232 } | 232 } |
| 233 if (arguments.length > 1) { | 233 if (arguments.length > 1) { |
| 234 var extra = arguments.getRange(1, arguments.length - 1); | 234 var extra = arguments.sublist(1); |
| 235 helpAndFail('Error: Extra arguments: ${extra.join(" ")}'); | 235 helpAndFail('Error: Extra arguments: ${extra.join(" ")}'); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void handler(Uri uri, int begin, int end, String message, | 238 void handler(Uri uri, int begin, int end, String message, |
| 239 api.Diagnostic kind) { | 239 api.Diagnostic kind) { |
| 240 diagnosticHandler.diagnosticHandler(uri, begin, end, message, kind); | 240 diagnosticHandler.diagnosticHandler(uri, begin, end, message, kind); |
| 241 } | 241 } |
| 242 | 242 |
| 243 Uri uri = cwd.resolve(arguments[0]); | 243 Uri uri = cwd.resolve(arguments[0]); |
| 244 if (packageRoot == null) { | 244 if (packageRoot == null) { |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } catch (ignored) { | 496 } catch (ignored) { |
| 497 print('Internal error: error while printing exception'); | 497 print('Internal error: error while printing exception'); |
| 498 } | 498 } |
| 499 try { | 499 try { |
| 500 print(trace); | 500 print(trace); |
| 501 } finally { | 501 } finally { |
| 502 exit(253); // 253 is recognized as a crash by our test scripts. | 502 exit(253); // 253 is recognized as a crash by our test scripts. |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 } | 505 } |
| OLD | NEW |