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

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: 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..933af1e8bf6579cfe8e48961ddb39d777a6c8f28 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(

Powered by Google App Engine
This is Rietveld 408576698