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 9caf929497f187d9dfbe50b2a1b65ee05318526f..0903f6e84aaf494005a61d4150989ddd4230f410 100644 |
--- a/pkg/compiler/lib/src/library_loader.dart |
+++ b/pkg/compiler/lib/src/library_loader.dart |
@@ -873,13 +873,12 @@ class _DillLibraryLoaderTask extends CompilerTask implements LibraryLoaderTask { |
_worldBuilder = new KernelWorldBuilder(reporter, program); |
program.libraries.forEach((ir.Library library) => _allLoadedLibraries |
.add(_worldBuilder.lookupLibrary(library.importUri))); |
- LibraryEntity rootLibrary = null; |
- if (program.mainMethod != null) { |
- rootLibrary = _worldBuilder |
- .lookupLibrary(program.mainMethod.enclosingLibrary.importUri); |
- } |
+ // TODO(efortuna): Handle `prgram.mainMethod == null` gracefully. |
return new _LoadedLibrariesAdapter( |
- rootLibrary, _allLoadedLibraries, _worldBuilder); |
+ _worldBuilder |
+ .lookupLibrary(program.mainMethod.enclosingLibrary.importUri), |
+ _allLoadedLibraries, |
+ _worldBuilder); |
}); |
}); |
} |