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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartParameter.java

Issue 9600049: Use NodeList where possible. (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/ast/DartParameter.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartParameter.java b/compiler/java/com/google/dart/compiler/ast/DartParameter.java
index 3e0d1db6ca01ba15fa821911b18b2362e602c838..d180ec9fc12db77c97b8dc9d86b0c8e71ed7d3f0 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartParameter.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartParameter.java
@@ -18,7 +18,7 @@ public class DartParameter extends DartDeclaration<DartExpression> implements Ha
private VariableElement symbol;
private DartTypeNode typeNode;
- private List<DartParameter> functionParameters;
+ private final NodeList<DartParameter> functionParameters;
Brian Wilkerson 2012/03/06 16:39:45 Why isn't this always getting initialized like we
scheglov 2012/03/06 17:11:46 I have to do this to distinguish between "normal"
private DartExpression defaultExpr;
private final Modifiers modifiers;
@@ -31,7 +31,12 @@ public class DartParameter extends DartDeclaration<DartExpression> implements Ha
Preconditions.checkArgument((name instanceof DartIdentifier)
|| (name instanceof DartPropertyAccess), "name");
this.typeNode = becomeParentOf(typeNode);
- this.functionParameters = becomeParentOf(functionParameters);
+ if (functionParameters != null) {
+ this.functionParameters = NodeList.create(this);
+ this.functionParameters.addAll(functionParameters);
+ } else {
+ this.functionParameters = null;
+ }
this.defaultExpr = becomeParentOf(defaultExpr);
this.modifiers = modifiers;
}
@@ -89,7 +94,9 @@ public class DartParameter extends DartDeclaration<DartExpression> implements Ha
if (defaultExpr != null) {
defaultExpr.accept(visitor);
}
- visitor.visit(functionParameters);
+ if (functionParameters != null) {
+ functionParameters.accept(visitor);
+ }
}
@Override

Powered by Google App Engine
This is Rietveld 408576698