Index: sdk/lib/_internal/compiler/implementation/library_loader.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/library_loader.dart b/sdk/lib/_internal/compiler/implementation/library_loader.dart |
index d7b538e6acba61e10ae1732c6fe69eb7db276732..f155441955fe1327d3e88b5ecd26de549614d0c6 100644 |
--- a/sdk/lib/_internal/compiler/implementation/library_loader.dart |
+++ b/sdk/lib/_internal/compiler/implementation/library_loader.dart |
@@ -138,7 +138,7 @@ class LibraryLoaderTask extends LibraryLoader { |
assert(currentHandler == null); |
currentHandler = new LibraryDependencyHandler(compiler); |
LibraryElement library = |
- createLibrary(currentHandler, uri, node, canonicalUri); |
+ createLibrary(currentHandler, null, uri, node, canonicalUri); |
ngeoffray
2013/01/16 15:40:57
Why is that null here?
Johnni Winther
2013/01/21 09:27:54
The importing uri. Since this is a load from the o
|
currentHandler.computeExports(); |
currentHandler = null; |
return library; |
@@ -245,7 +245,8 @@ class LibraryLoaderTask extends LibraryLoader { |
LibraryElement loadCoreLibrary(LibraryDependencyHandler handler) { |
if (compiler.coreLibrary == null) { |
Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); |
- compiler.coreLibrary = createLibrary(handler, coreUri, null, coreUri); |
+ compiler.coreLibrary |
+ = createLibrary(handler, null, coreUri, null, coreUri); |
ngeoffray
2013/01/16 15:40:57
ditto
Johnni Winther
2013/01/21 09:27:54
The import is synthetic and we need no special acc
|
} |
return compiler.coreLibrary; |
} |
@@ -294,10 +295,11 @@ class LibraryLoaderTask extends LibraryLoader { |
void registerLibraryFromTag(LibraryDependencyHandler handler, |
LibraryElement library, |
LibraryDependency tag) { |
+ Uri importingUri = library.uri; |
Uri base = library.entryCompilationUnit.script.uri; |
Uri resolved = base.resolve(tag.uri.dartString.slowToString()); |
LibraryElement loadedLibrary = |
- createLibrary(handler, resolved, tag.uri, resolved); |
+ createLibrary(handler, importingUri, resolved, tag.uri, resolved); |
handler.registerDependency(library, tag, loadedLibrary); |
if (!loadedLibrary.hasLibraryName()) { |
@@ -309,18 +311,21 @@ class LibraryLoaderTask extends LibraryLoader { |
} |
/** |
- * Create (or reuse) a library element for the library located at [uri]. |
+ * Create (or reuse) a library element for the library located at [scriptUri]. |
* If a new library is created, the [handler] is notified. |
*/ |
LibraryElement createLibrary(LibraryDependencyHandler handler, |
- Uri uri, Node node, Uri canonicalUri) { |
+ Uri importingUri, |
+ Uri scriptUri, Node node, Uri canonicalUri) { |
bool newLibrary = false; |
+ Uri uri = compiler.resolveScriptUri(importingUri, scriptUri, node); |
+ if (uri == null) return null; |
LibraryElement createLibrary() { |
newLibrary = true; |
Script script = compiler.readScript(uri, node); |
LibraryElement element = new LibraryElementX(script, canonicalUri); |
handler.registerNewLibrary(element); |
- native.maybeEnableNative(compiler, element, uri); |
+ native.maybeEnableNative(compiler, element); |
return element; |
} |
LibraryElement library; |