Index: pkg/compiler/lib/src/deferred_load.dart |
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart |
index 77d9266b5a19fd28d376ec1dcd017154bb4fb5d6..d233398127bc1fcc50a7ee289ba2a9f2067c53cd 100644 |
--- a/pkg/compiler/lib/src/deferred_load.dart |
+++ b/pkg/compiler/lib/src/deferred_load.dart |
@@ -791,11 +791,11 @@ class DeferredLoadTask extends CompilerTask { |
compiler.impactStrategy.onImpactUsed(IMPACT_USE); |
} |
- void beforeResolution(Compiler compiler) { |
- if (compiler.mainApp == null) return; |
+ void beforeResolution(LibraryEntity mainLibrary) { |
+ if (mainLibrary == null) return; |
// TODO(johnniwinther): Support deferred load for kernel based elements. |
if (compiler.options.loadFromDill) return; |
- _allDeferredImports[_fakeMainImport] = compiler.mainApp; |
+ _allDeferredImports[_fakeMainImport] = mainLibrary; |
var lastDeferred; |
// When detecting duplicate prefixes of deferred libraries there are 4 |
// cases of duplicate prefixes: |
@@ -855,8 +855,9 @@ class DeferredLoadTask extends CompilerTask { |
import, MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX); |
} else { |
prefixDeferredImport[prefix] = import; |
+ Uri mainLibraryUri = compiler.mainLibraryUri; |
_deferredImportDescriptions[key] = |
- new ImportDescription(import, library, compiler); |
+ new ImportDescription(import, library, mainLibraryUri); |
} |
isProgramSplit = true; |
lastDeferred = import; |
@@ -1031,9 +1032,9 @@ class ImportDescription { |
final LibraryElement _importingLibrary; |
ImportDescription( |
- ImportElement import, LibraryElement importingLibrary, Compiler compiler) |
- : importingUri = uri_extras.relativize(compiler.mainApp.canonicalUri, |
- importingLibrary.canonicalUri, false), |
+ ImportElement import, LibraryElement importingLibrary, Uri mainLibraryUri) |
+ : importingUri = uri_extras.relativize( |
+ mainLibraryUri, importingLibrary.canonicalUri, false), |
prefix = import.prefix.name, |
_importingLibrary = importingLibrary; |