Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: sdk/lib/_internal/compiler/implementation/patch_parser.dart

Issue 11967010: Internal libraries supported. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698