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 import 'dart:io' | 8 import 'dart:io' |
9 show exit, File, FileMode, Platform, RandomAccessFile; | 9 show exit, File, FileMode, Platform, RandomAccessFile; |
10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 | 597 |
598 void helpAndFail(String message) { | 598 void helpAndFail(String message) { |
599 help(); | 599 help(); |
600 print(''); | 600 print(''); |
601 fail(message); | 601 fail(message); |
602 } | 602 } |
603 | 603 |
604 void main(List<String> arguments) { | 604 void main(List<String> arguments) { |
605 runZoned(() => compilerMain(arguments), onError: (exception, trace) { | 605 runZoned(() => compilerMain(arguments), onError: (exception, trace) { |
606 try { | 606 try { |
607 print('Internal error: $exception'); | 607 print('The compiler crashed: $exception'); |
608 } catch (ignored) { | 608 } catch (ignored) { |
609 print('Internal error: error while printing exception'); | 609 print('The compiler crashed: error while printing exception'); |
610 } | 610 } |
611 | 611 |
612 try { | 612 try { |
613 if (trace != null) { | 613 if (trace != null) { |
614 print(trace); | 614 print(trace); |
615 } | 615 } |
616 } finally { | 616 } finally { |
617 exit(253); // 253 is recognized as a crash by our test scripts. | 617 exit(253); // 253 is recognized as a crash by our test scripts. |
618 } | 618 } |
619 }); | 619 }); |
620 } | 620 } |
OLD | NEW |