Chromium Code Reviews| 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 |