Index: dart/sdk/lib/_internal/compiler/implementation/library_loader.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart b/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart |
index b7ceefc04d95bfbfb9dd6f05e61bcd0f775b39f8..1217a11362535178e818c08fd1df82c15e8fd43d 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart |
@@ -498,23 +498,33 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask { |
return new Future.value(library); |
} |
return compiler.withCurrentElement(importingLibrary, () { |
- return compiler.readScript(node, readableUri) |
- .then((Script script) { |
- if (script == null) return null; |
- LibraryElement element = new LibraryElementX(script, resolvedUri); |
- compiler.withCurrentElement(element, () { |
- handler.registerNewLibrary(element); |
- native.maybeEnableNative(compiler, element); |
- libraryCanonicalUriMap[resolvedUri] = element; |
- compiler.scanner.scanLibrary(element); |
- }); |
- return processLibraryTags(handler, element).then((_) { |
- compiler.withCurrentElement(element, () { |
- handler.registerLibraryExports(element); |
- }); |
- return element; |
- }); |
+ return compiler.readScript(node, readableUri).then((Script script) { |
+ if (script == null) return null; |
+ LibraryElement element = |
+ createLibrarySync(handler, script, resolvedUri); |
+ return processLibraryTags(handler, element).then((_) { |
+ compiler.withCurrentElement(element, () { |
+ handler.registerLibraryExports(element); |
}); |
+ return element; |
+ }); |
+ }); |
+ }); |
+ } |
+ |
+ LibraryElement createLibrarySync( |
+ LibraryDependencyHandler handler, |
+ Script script, |
+ Uri resolvedUri) { |
+ LibraryElement element = new LibraryElementX(script, resolvedUri); |
+ return compiler.withCurrentElement(element, () { |
+ if (handler != null) { |
+ handler.registerNewLibrary(element); |
+ libraryCanonicalUriMap[resolvedUri] = element; |
+ } |
+ native.maybeEnableNative(compiler, element); |
+ compiler.scanner.scanLibrary(element); |
+ return element; |
}); |
} |
} |