| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 class AbortLeg { | 338 class AbortLeg { |
| 339 final message; | 339 final message; |
| 340 AbortLeg(this.message); | 340 AbortLeg(this.message); |
| 341 toString() => 'Aborted due to --throw-on-error: $message'; | 341 toString() => 'Aborted due to --throw-on-error: $message'; |
| 342 } | 342 } |
| 343 | 343 |
| 344 void writeString(Uri uri, String text) { | 344 void writeString(Uri uri, String text) { |
| 345 if (uri.scheme != 'file') { | 345 if (uri.scheme != 'file') { |
| 346 fail('Error: Unhandled scheme ${uri.scheme}.'); | 346 fail('Error: Unhandled scheme ${uri.scheme}.'); |
| 347 } | 347 } |
| 348 var file = new File(uriPathToNative(uri.path)).openSync(FileMode.WRITE); | 348 var file = new File(uriPathToNative(uri.path)).openSync(mode: FileMode.WRITE); |
| 349 file.writeStringSync(text); | 349 file.writeStringSync(text); |
| 350 file.closeSync(); | 350 file.closeSync(); |
| 351 } | 351 } |
| 352 | 352 |
| 353 void fail(String message) { | 353 void fail(String message) { |
| 354 print(message); | 354 print(message); |
| 355 exit(1); | 355 exit(1); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void compilerMain(Options options) { | 358 void compilerMain(Options options) { |
| (...skipping 137 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 |