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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/VariableElementImplementation.java

Issue 9692002: Step back and remove more getNode() invocations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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: compiler/java/com/google/dart/compiler/resolver/VariableElementImplementation.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/VariableElementImplementation.java b/compiler/java/com/google/dart/compiler/resolver/VariableElementImplementation.java
index 2eba4c9a957db74a39234fa9c6ca3299e4d3f75a..209853f74ce531f365ad37da70904d532c756123 100644
--- a/compiler/java/com/google/dart/compiler/resolver/VariableElementImplementation.java
+++ b/compiler/java/com/google/dart/compiler/resolver/VariableElementImplementation.java
@@ -7,26 +7,37 @@ package com.google.dart.compiler.resolver;
import com.google.dart.compiler.ast.DartExpression;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.Modifiers;
+import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.type.Type;
class VariableElementImplementation extends AbstractElement implements VariableElement {
+ private final Element owner;
private final ElementKind kind;
private final Modifiers modifiers;
private final boolean isNamed;
private final DartExpression defaultValue;
+ private final SourceInfo nameLocation;
// The field element is set for constructor parameters of the form
// this.foo by the resolver.
private FieldElement fieldElement;
private Type type;
- VariableElementImplementation(DartNode node, String name, ElementKind kind, Modifiers modifiers,
- boolean isNamed, DartExpression defaultValue) {
+ VariableElementImplementation(Element owner,
+ DartNode node,
+ SourceInfo nameLocation,
+ String name,
+ ElementKind kind,
+ Modifiers modifiers,
+ boolean isNamed,
+ DartExpression defaultValue) {
super(node, name);
+ this.owner = owner;
this.isNamed = isNamed;
this.kind = kind;
this.modifiers = modifiers;
this.defaultValue = defaultValue;
+ this.nameLocation = nameLocation;
}
@Override
@@ -35,6 +46,11 @@ class VariableElementImplementation extends AbstractElement implements VariableE
}
@Override
+ public SourceInfo getNameLocation() {
+ return nameLocation;
+ }
+
+ @Override
public Modifiers getModifiers() {
return modifiers;
}
@@ -67,4 +83,9 @@ class VariableElementImplementation extends AbstractElement implements VariableE
public FieldElement getParameterInitializerElement() {
return fieldElement;
}
+
+ @Override
+ public Element getEnclosingElement() {
+ return owner;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698