| Index: lib/compiler/implementation/scanner/scanner_task.dart
|
| diff --git a/lib/compiler/implementation/scanner/scanner_task.dart b/lib/compiler/implementation/scanner/scanner_task.dart
|
| index 899bf39c5cd3a8a82670f2a12cedb5cc6b76365f..aedd3a33536a4e7c4d5b594a57fe2aa10dff7024 100644
|
| --- a/lib/compiler/implementation/scanner/scanner_task.dart
|
| +++ b/lib/compiler/implementation/scanner/scanner_task.dart
|
| @@ -118,14 +118,20 @@ class ScannerTask extends CompilerTask {
|
|
|
| LibraryElement loadLibrary(Uri uri, Node node, Uri canonicalUri) {
|
| bool newLibrary = false;
|
| - LibraryElement library =
|
| - compiler.libraries.putIfAbsent(uri.toString(), () {
|
| - newLibrary = true;
|
| - Script script = compiler.readScript(uri, node);
|
| - LibraryElement element = new LibraryElement(script, canonicalUri);
|
| - native.maybeEnableNative(compiler, element, uri);
|
| - return element;
|
| - });
|
| + LibraryElement createLibrary() {
|
| + newLibrary = true;
|
| + Script script = compiler.readScript(uri, node);
|
| + LibraryElement element = new LibraryElement(script, canonicalUri);
|
| + native.maybeEnableNative(compiler, element, uri);
|
| + return element;
|
| + }
|
| + LibraryElement library;
|
| + if (canonicalUri === null) {
|
| + library = createLibrary();
|
| + } else {
|
| + library = compiler.libraries.putIfAbsent(canonicalUri.toString(),
|
| + createLibrary);
|
| + }
|
| if (newLibrary) {
|
| compiler.withCurrentElement(library, () {
|
| scanLibrary(library);
|
|
|