Chromium Code Reviews| 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..6f0244bfcd1c3cb48afb9ad345a0f025c60cbdef 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, originLibrary.uri, 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); |
|
ngeoffray
2013/01/16 15:40:57
line too long
Johnni Winther
2013/01/21 09:27:54
Done.
|
| + } |
| }); |
| - // 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( |