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

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: Updated cf. comments Created 4 years, 8 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void reportCrashInUserCode(String message, exception, stackTrace) { 1059 void reportCrashInUserCode(String message, exception, stackTrace) {
1060 _reporter.onCrashInUserCode(message, exception, stackTrace); 1060 reporter.onCrashInUserCode(message, exception, stackTrace);
1061 } 1061 }
1062 1062
1063 /// Messages for which compile-time errors are reported but compilation 1063 /// Messages for which compile-time errors are reported but compilation
1064 /// continues regardless. 1064 /// continues regardless.
1065 static const List<MessageKind> BENIGN_ERRORS = const <MessageKind>[ 1065 static const List<MessageKind> BENIGN_ERRORS = const <MessageKind>[
1066 MessageKind.INVALID_METADATA, 1066 MessageKind.INVALID_METADATA,
1067 MessageKind.INVALID_METADATA_GENERIC, 1067 MessageKind.INVALID_METADATA_GENERIC,
1068 ]; 1068 ];
1069 1069
1070 bool markCompilationAsFailed(DiagnosticMessage message, api.Diagnostic kind) { 1070 bool markCompilationAsFailed(DiagnosticMessage message, api.Diagnostic kind) {
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 api.Diagnostic.CRASH); 1764 api.Diagnostic.CRASH);
1765 } 1765 }
1766 pleaseReportCrash(); 1766 pleaseReportCrash();
1767 } 1767 }
1768 } catch (doubleFault) { 1768 } catch (doubleFault) {
1769 // Ignoring exceptions in exception handling. 1769 // Ignoring exceptions in exception handling.
1770 } 1770 }
1771 throw error; 1771 throw error;
1772 } 1772 }
1773 1773
1774 @override
1774 void onCrashInUserCode(String message, exception, stackTrace) { 1775 void onCrashInUserCode(String message, exception, stackTrace) {
1775 hasCrashed = true; 1776 hasCrashed = true;
1776 print('$message: ${tryToString(exception)}'); 1777 print('$message: ${tryToString(exception)}');
1777 print(tryToString(stackTrace)); 1778 print(tryToString(stackTrace));
1778 } 1779 }
1779 1780
1780 void reportSuppressedMessagesSummary() { 1781 void reportSuppressedMessagesSummary() {
1781 if (!options.showAllPackageWarnings && !options.suppressWarnings) { 1782 if (!options.showAllPackageWarnings && !options.suppressWarnings) {
1782 suppressedWarnings.forEach((Uri uri, SuppressionInfo info) { 1783 suppressedWarnings.forEach((Uri uri, SuppressionInfo info) {
1783 MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS; 1784 MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 _ElementScanner(this.scanner); 2016 _ElementScanner(this.scanner);
2016 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2017 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2017 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2018 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2018 } 2019 }
2019 2020
2020 class _EmptyEnvironment implements Environment { 2021 class _EmptyEnvironment implements Environment {
2021 const _EmptyEnvironment(); 2022 const _EmptyEnvironment();
2022 2023
2023 String valueOf(String key) => null; 2024 String valueOf(String key) => null;
2024 } 2025 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698