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

Unified Diff: pkg/compiler/lib/src/library_loader.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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 5793aa425829a855f6c1ed29ddd432d639e225e6..f4cd6796b907029185f8a5b48c994e0692a846d1 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -345,7 +345,17 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
return measure(() {
assert(currentHandler == null);
- wrapper(lib) => reuseLibrary(lib).then((reuse) => reuse ? lib : null);
+ Future<LibraryElement> wrapper(LibraryElement library) {
+ try {
+ return reuseLibrary(library)
+ .then((bool reuse) => reuse ? library : null);
+ } catch (exception, trace) {
+ reporter.onCrashInUserCode(
+ 'Uncaught exception in reuseLibrary', exception, trace);
+ rethrow;
+ }
+ }
+
List<Future<LibraryElement>> reusedLibrariesFuture =
// TODO(sigmund): make measurements separate from compiler
compiler.reuseLibraryTask.measure(
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart ('k') | tests/compiler/dart2js/diagnostic_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698