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( |