Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart2js.dart

Issue 24082005: Detect asynchronous dart2js crashes correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import 'dart:math' as math; 9 import 'dart:math' as math;
10 10
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 exit(0); 555 exit(0);
556 } 556 }
557 557
558 void helpAndFail(String message) { 558 void helpAndFail(String message) {
559 help(); 559 help();
560 print(''); 560 print('');
561 fail(message); 561 fail(message);
562 } 562 }
563 563
564 void mainWithErrorHandler(Options options) { 564 void mainWithErrorHandler(Options options) {
565 new Future.sync(() => compilerMain(options)).catchError((exception) { 565 runZonedExperimental(() => compilerMain(options), onError: (exception) {
566 try { 566 try {
567 print('Internal error: $exception'); 567 print('Internal error: $exception');
568 } catch (ignored) { 568 } catch (ignored) {
569 print('Internal error: error while printing exception'); 569 print('Internal error: error while printing exception');
570 } 570 }
571 571
572 try { 572 try {
573 var trace = getAttachedStackTrace(exception); 573 var trace = getAttachedStackTrace(exception);
574 if (trace != null) { 574 if (trace != null) {
575 print(trace); 575 print(trace);
576 } 576 }
577 } finally { 577 } finally {
578 exit(253); // 253 is recognized as a crash by our test scripts. 578 exit(253); // 253 is recognized as a crash by our test scripts.
579 } 579 }
580 }); 580 });
581 } 581 }
582 582
583 void main() { 583 void main() {
584 mainWithErrorHandler(new Options()); 584 mainWithErrorHandler(new Options());
585 } 585 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698