| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 exit(0); | 583 exit(0); |
| 584 } | 584 } |
| 585 | 585 |
| 586 void helpAndFail(String message) { | 586 void helpAndFail(String message) { |
| 587 help(); | 587 help(); |
| 588 print(''); | 588 print(''); |
| 589 fail(message); | 589 fail(message); |
| 590 } | 590 } |
| 591 | 591 |
| 592 void main(List<String> arguments) { | 592 void main(List<String> arguments) { |
| 593 runZoned(() => compilerMain(arguments), onError: (exception) { | 593 runZoned(() => compilerMain(arguments), onError: (exception, trace) { |
| 594 try { | 594 try { |
| 595 print('Internal error: $exception'); | 595 print('Internal error: $exception'); |
| 596 } catch (ignored) { | 596 } catch (ignored) { |
| 597 print('Internal error: error while printing exception'); | 597 print('Internal error: error while printing exception'); |
| 598 } | 598 } |
| 599 | 599 |
| 600 try { | 600 try { |
| 601 var trace = getAttachedStackTrace(exception); | |
| 602 if (trace != null) { | 601 if (trace != null) { |
| 603 print(trace); | 602 print(trace); |
| 604 } | 603 } |
| 605 } finally { | 604 } finally { |
| 606 exit(253); // 253 is recognized as a crash by our test scripts. | 605 exit(253); // 253 is recognized as a crash by our test scripts. |
| 607 } | 606 } |
| 608 }); | 607 }); |
| 609 } | 608 } |
| OLD | NEW |