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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/registry.dart

Issue 422483002: Mix in [TreeElementMixin] only on nodes that need it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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: sdk/lib/_internal/compiler/implementation/resolution/registry.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/registry.dart b/sdk/lib/_internal/compiler/implementation/resolution/registry.dart
index 2dc496234c6efe9c54daf6d2bcda30cfef2b3cf4..cec5dd9519be1ca7c27902aa1232276f5e5dd0b2 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/registry.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/registry.dart
@@ -31,13 +31,18 @@ class ResolutionRegistry extends Registry {
// Node-to-Element mapping functionality.
//////////////////////////////////////////////////////////////////////////////
+ /// Register [node] as the declaration of [element].
+ void defineFunction(FunctionExpression node, FunctionElement element) {
+ mapping[node] = element;
+ }
+
/// Register [node] as a reference to [element].
Element useElement(Node node, Element element) {
if (element == null) return null;
return mapping[node] = element;
}
- /// Register [node] as a declaration of [element].
+ /// Register [node] as the declaration of [element].
void defineElement(Node node, Element element) {
mapping[node] = element;
}
@@ -47,6 +52,17 @@ class ResolutionRegistry extends Registry {
return mapping[node];
}
+ /// Sets the loop variable of the for-in [node] to be [element].
+ void setForInVariable(ForIn node, Element element) {
+ mapping[node] = element;
+ }
+
+ /// Sets the target constructor [node] to be [element].
+ void setRedirectingTargetConstructor(RedirectingFactoryBody node,
+ ConstructorElement element) {
+ useElement(node, element);
+ }
+
//////////////////////////////////////////////////////////////////////////////
// Node-to-Selector mapping functionality.
//////////////////////////////////////////////////////////////////////////////
@@ -84,7 +100,6 @@ class ResolutionRegistry extends Registry {
DartType useType(Node annotation, DartType type) {
if (type != null) {
mapping.setType(annotation, type);
- useElement(annotation, type.element);
}
return type;
}

Powered by Google App Engine
This is Rietveld 408576698