Chromium Code Reviews| Index: lib/compiler/implementation/compiler.dart |
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart |
| index 9853fa87d9eb8e195969797c190b654d2c844ff9..d23c70469e59b0e81818a576fd109a55f53d55d6 100644 |
| --- a/lib/compiler/implementation/compiler.dart |
| +++ b/lib/compiler/implementation/compiler.dart |
| @@ -445,7 +445,7 @@ class Compiler implements DiagnosticListener { |
| // take advantage of this as core and coreimpl import js_helper |
| // and see Dynamic this way. |
| withCurrentElement(dynamicClass, () { |
| - library.define(dynamicClass, this); |
| + library.addToScope(dynamicClass, this); |
| }); |
| } |
| } |
| @@ -524,12 +524,12 @@ class Compiler implements DiagnosticListener { |
| } |
| void applyLibraryPatch(LibraryElement original, LibraryElement patch) { |
| - Link<Element> patches = patch.topLevelElements; |
| + Link<Element> patches = patch.localMembers; |
| applyContainerPatch(original, patches, original.findLocal); |
|
Lasse Reichstein Nielsen
2012/08/08 14:22:12
If both ClassElement and LibraryElement define a f
Anders Johnsen
2012/08/08 17:30:37
Done.
|
| // Copy imports from patch to original library. |
| Map<String, LibraryElement> delayedPatches = <LibraryElement>{}; |
| - Uri patchBase = patch.script.uri; |
| + Uri patchBase = patch.uri; |
| for (ScriptTag tag in patch.tags.reverse()) { |
| if (tag.isImport()) { |
| StringNode argument = tag.argument; |
| @@ -553,7 +553,8 @@ class Compiler implements DiagnosticListener { |
| }); |
| } |
| - void applyContainerPatch(ContainerElement original, Link<Element> patches, |
| + void applyContainerPatch(ScopeContainerElement original, |
| + Link<Element> patches, |
| Element lookup(SourceString name)) { |
| while (!patches.isEmpty()) { |
| Element patchElement = patches.head; |
| @@ -689,7 +690,7 @@ class Compiler implements DiagnosticListener { |
| ClassNode node = original.parseNode(this); |
| // Parse patch class with "patch" parser. |
| ClassNode patchNode = patchParser.parsePatchClassNode(patch); |
| - Link<Element> patches = patch.members; |
| + Link<Element> patches = patch.localMembers; |
| Element lookupMemberOrConstructor(SourceString name) { |
| Element result = original.lookupLocalMember(name); |
| if (result !== null) return result; |
| @@ -706,17 +707,17 @@ class Compiler implements DiagnosticListener { |
| /** Define the JS helper functions in the given library. */ |
| void addForeignFunctions(LibraryElement library) { |
| - library.define(new ForeignElement( |
| + library.addToScope(new ForeignElement( |
| const SourceString('JS'), library), this); |
| - library.define(new ForeignElement( |
| + library.addToScope(new ForeignElement( |
| const SourceString('UNINTERCEPTED'), library), this); |
| - library.define(new ForeignElement( |
| + library.addToScope(new ForeignElement( |
| const SourceString('JS_HAS_EQUALS'), library), this); |
| - library.define(new ForeignElement( |
| + library.addToScope(new ForeignElement( |
| const SourceString('JS_CURRENT_ISOLATE'), library), this); |
| - library.define(new ForeignElement( |
| + library.addToScope(new ForeignElement( |
| const SourceString('JS_CALL_IN_ISOLATE'), library), this); |
| - library.define(new ForeignElement( |
| + library.addToScope(new ForeignElement( |
| const SourceString('DART_CLOSURE_TO_JS'), library), this); |
| } |