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

Unified Diff: frog/leg/elements/elements.dart

Issue 9699033: Introduce FieldParameterElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and create a separate map for the fields. 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: frog/leg/elements/elements.dart
diff --git a/frog/leg/elements/elements.dart b/frog/leg/elements/elements.dart
index c7d7d39ccda1ab5b580b83ecbab20afb20eff82c..2a6eeeec3049886d27245d1b61ee468631293a47 100644
--- a/frog/leg/elements/elements.dart
+++ b/frog/leg/elements/elements.dart
@@ -46,6 +46,10 @@ class ElementKind {
const ElementKind('variable', ElementCategory.VARIABLE);
static final ElementKind PARAMETER =
const ElementKind('parameter', ElementCategory.VARIABLE);
+ // Parameters in constructors that directly initialize fields. For example:
+ // [:A(this.field):].
+ static final ElementKind FIELD_PARAMETER =
+ const ElementKind('field_parameter', ElementCategory.VARIABLE);
static final ElementKind FUNCTION =
const ElementKind('function', ElementCategory.FUNCTION);
static final ElementKind CLASS =
@@ -351,6 +355,21 @@ class VariableElement extends Element {
Token position() => findMyName(variables.position());
}
+/**
+ * Parameters in constructors that directly initialize fields. For example:
+ * [:A(this.field):].
+ */
+class FieldParameterElement extends VariableElement {
+ VariableElement fieldElement;
+
+ FieldParameterElement(SourceString name,
+ this.fieldElement,
+ VariableListElement variables,
+ Element enclosing,
+ Node node)
+ : super(name, variables, ElementKind.FIELD_PARAMETER, enclosing, node);
+}
+
// This element represents a list of variable or field declaration.
// It contains the node, and the type. A [VariableElement] always
// references its [VariableListElement]. It forwards its

Powered by Google App Engine
This is Rietveld 408576698