Index: sdk/lib/_internal/compiler/implementation/patch_parser.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/patch_parser.dart b/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
index af1ae5f919b455178b2daf90570ec0b0a900f5c7..57dbd25840b52b59d57df689f77e5136c7e2731e 100644 |
--- a/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
+++ b/sdk/lib/_internal/compiler/implementation/patch_parser.dart |
@@ -136,22 +136,25 @@ class PatchParserTask extends leg.CompilerTask { |
Uri patchUri, LibraryElement originLibrary) { |
leg.Script script = compiler.readScript(patchUri, null); |
- var patchLibrary = new LibraryElementX(script, patchUri, originLibrary); |
- handler.registerNewLibrary(patchLibrary); |
- LinkBuilder<tree.LibraryTag> imports = new LinkBuilder<tree.LibraryTag>(); |
- compiler.withCurrentElement(patchLibrary.entryCompilationUnit, () { |
- // This patches the elements of the patch library into [library]. |
- // Injected elements are added directly under the compilation unit. |
- // Patch elements are stored on the patched functions or classes. |
- scanLibraryElements(patchLibrary.entryCompilationUnit, imports); |
+ var patchLibrary = new LibraryElementX(script, null, originLibrary); |
+ compiler.withCurrentElement(patchLibrary, () { |
+ handler.registerNewLibrary(patchLibrary); |
+ LinkBuilder<tree.LibraryTag> imports = new LinkBuilder<tree.LibraryTag>(); |
+ compiler.withCurrentElement(patchLibrary.entryCompilationUnit, () { |
+ // This patches the elements of the patch library into [library]. |
+ // Injected elements are added directly under the compilation unit. |
+ // Patch elements are stored on the patched functions or classes. |
+ scanLibraryElements(patchLibrary.entryCompilationUnit, imports); |
+ }); |
+ // After scanning declarations, we handle the import tags in the patch. |
+ // TODO(lrn): These imports end up in the original library and are in |
+ // scope for the original methods too. This should be fixed. |
+ compiler.importHelperLibrary(originLibrary); |
+ for (tree.LibraryTag tag in imports.toLink()) { |
+ compiler.libraryLoader.registerLibraryFromTag( |
+ handler, patchLibrary, tag); |
+ } |
}); |
- // After scanning declarations, we handle the import tags in the patch. |
- // TODO(lrn): These imports end up in the original library and are in |
- // scope for the original methods too. This should be fixed. |
- compiler.importHelperLibrary(originLibrary); |
- for (tree.LibraryTag tag in imports.toLink()) { |
- compiler.libraryLoader.registerLibraryFromTag(handler, patchLibrary, tag); |
- } |
} |
void scanLibraryElements( |