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.cmdline; | 5 library dart2js.cmdline; |
6 | 6 |
7 import 'dart:async' | 7 import 'dart:async' |
8 show Future, EventSink; | 8 show Future, EventSink; |
9 import 'dart:convert' show UTF8, LineSplitter; | 9 import 'dart:convert' show UTF8, LineSplitter; |
10 import 'dart:io' | 10 import 'dart:io' |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 return; | 647 return; |
648 } | 648 } |
649 internalMain(arguments); | 649 internalMain(arguments); |
650 } | 650 } |
651 | 651 |
652 var exitFunc = exit; | 652 var exitFunc = exit; |
653 var compileFunc = api.compile; | 653 var compileFunc = api.compile; |
654 | 654 |
655 Future<api.CompilationResult> internalMain(List<String> arguments) { | 655 Future<api.CompilationResult> internalMain(List<String> arguments) { |
656 Future onError(exception, trace) { | 656 Future onError(exception, trace) { |
| 657 // If we are already trying to exit, just continue exiting. |
| 658 if (exception == _EXIT_SIGNAL) throw exception; |
| 659 |
657 try { | 660 try { |
658 print('The compiler crashed: $exception'); | 661 print('The compiler crashed: $exception'); |
659 } catch (ignored) { | 662 } catch (ignored) { |
660 print('The compiler crashed: error while printing exception'); | 663 print('The compiler crashed: error while printing exception'); |
661 } | 664 } |
662 | 665 |
663 try { | 666 try { |
664 if (trace != null) { | 667 if (trace != null) { |
665 print(trace); | 668 print(trace); |
666 } | 669 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 } else if (exitCode == 253) { | 720 } else if (exitCode == 253) { |
718 print(">>> TEST CRASH"); | 721 print(">>> TEST CRASH"); |
719 } else { | 722 } else { |
720 print(">>> TEST FAIL"); | 723 print(">>> TEST FAIL"); |
721 } | 724 } |
722 stderr.writeln(">>> EOF STDERR"); | 725 stderr.writeln(">>> EOF STDERR"); |
723 subscription.resume(); | 726 subscription.resume(); |
724 }); | 727 }); |
725 }); | 728 }); |
726 } | 729 } |
OLD | NEW |