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

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 1914973002: Reinsert (and test) handling of exceptions from user code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show EventSink, Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'cache_strategy.dart' show CacheStrategy; 10 import 'cache_strategy.dart' show CacheStrategy;
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 reporter 1049 reporter
1050 .log('Compiled ${enqueuer.codegen.generatedCode.length} methods.'); 1050 .log('Compiled ${enqueuer.codegen.generatedCode.length} methods.');
1051 progress.reset(); 1051 progress.reset();
1052 } 1052 }
1053 return backend.codegen(work); 1053 return backend.codegen(work);
1054 } 1054 }
1055 1055
1056 void reportDiagnostic(DiagnosticMessage message, 1056 void reportDiagnostic(DiagnosticMessage message,
1057 List<DiagnosticMessage> infos, api.Diagnostic kind); 1057 List<DiagnosticMessage> infos, api.Diagnostic kind);
1058 1058
1059
ahe 2016/04/25 10:13:33 Extra line.
Johnni Winther 2016/04/25 10:33:24 Done.
1059 void reportCrashInUserCode(String message, exception, stackTrace) { 1060 void reportCrashInUserCode(String message, exception, stackTrace) {
1060 _reporter.onCrashInUserCode(message, exception, stackTrace); 1061 reporter.onCrashInUserCode(message, exception, stackTrace);
1061 } 1062 }
1062 1063
1063 /// Messages for which compile-time errors are reported but compilation 1064 /// Messages for which compile-time errors are reported but compilation
1064 /// continues regardless. 1065 /// continues regardless.
1065 static const List<MessageKind> BENIGN_ERRORS = const <MessageKind>[ 1066 static const List<MessageKind> BENIGN_ERRORS = const <MessageKind>[
1066 MessageKind.INVALID_METADATA, 1067 MessageKind.INVALID_METADATA,
1067 MessageKind.INVALID_METADATA_GENERIC, 1068 MessageKind.INVALID_METADATA_GENERIC,
1068 ]; 1069 ];
1069 1070
1070 bool markCompilationAsFailed(DiagnosticMessage message, api.Diagnostic kind) { 1071 bool markCompilationAsFailed(DiagnosticMessage message, api.Diagnostic kind) {
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 api.Diagnostic.CRASH); 1765 api.Diagnostic.CRASH);
1765 } 1766 }
1766 pleaseReportCrash(); 1767 pleaseReportCrash();
1767 } 1768 }
1768 } catch (doubleFault) { 1769 } catch (doubleFault) {
1769 // Ignoring exceptions in exception handling. 1770 // Ignoring exceptions in exception handling.
1770 } 1771 }
1771 throw error; 1772 throw error;
1772 } 1773 }
1773 1774
1775 @override
1774 void onCrashInUserCode(String message, exception, stackTrace) { 1776 void onCrashInUserCode(String message, exception, stackTrace) {
1775 hasCrashed = true; 1777 hasCrashed = true;
1776 print('$message: ${tryToString(exception)}'); 1778 print('$message: ${tryToString(exception)}');
1777 print(tryToString(stackTrace)); 1779 print(tryToString(stackTrace));
1778 } 1780 }
1779 1781
1780 void reportSuppressedMessagesSummary() { 1782 void reportSuppressedMessagesSummary() {
1781 if (!options.showAllPackageWarnings && !options.suppressWarnings) { 1783 if (!options.showAllPackageWarnings && !options.suppressWarnings) {
1782 suppressedWarnings.forEach((Uri uri, SuppressionInfo info) { 1784 suppressedWarnings.forEach((Uri uri, SuppressionInfo info) {
1783 MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS; 1785 MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 _ElementScanner(this.scanner); 2017 _ElementScanner(this.scanner);
2016 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2018 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2017 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2019 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2018 } 2020 }
2019 2021
2020 class _EmptyEnvironment implements Environment { 2022 class _EmptyEnvironment implements Environment {
2021 const _EmptyEnvironment(); 2023 const _EmptyEnvironment();
2022 2024
2023 String valueOf(String key) => null; 2025 String valueOf(String key) => null;
2024 } 2026 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698