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

Unified Diff: lib/compiler/implementation/compiler.dart

Issue 10832203: Refactor Library/CompilationUnit and how we define local Scope. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: 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);
}
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | lib/compiler/implementation/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698