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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartFunction.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/DartFunction.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartFunction.java b/compiler/java/com/google/dart/compiler/ast/DartFunction.java
index 28baa5f3c312379bc74754818b2ae69eaa289de7..2c28f807e96729f093e934c2eef291ad589ac591 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartFunction.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartFunction.java
@@ -11,26 +11,22 @@ import java.util.List;
*/
public class DartFunction extends DartNode {
- private final List<DartParameter> params;
+ private final NodeList<DartParameter> parameters = NodeList.create(this);
private DartBlock body;
private DartTypeNode returnTypeNode;
- public DartFunction(List<DartParameter> arguments, DartBlock body, DartTypeNode returnTypeNode) {
- this.params = becomeParentOf(arguments);
+ public DartFunction(List<DartParameter> parameters, DartBlock body, DartTypeNode returnTypeNode) {
+ this.parameters.addAll(parameters);
this.body = becomeParentOf(body);
this.returnTypeNode = becomeParentOf(returnTypeNode);
}
- public void addParam(DartParameter param) {
- params.add(param);
- }
-
public DartBlock getBody() {
return body;
}
- public List<DartParameter> getParams() {
- return params;
+ public List<DartParameter> getParameters() {
+ return parameters;
}
public DartTypeNode getReturnTypeNode() {
@@ -39,7 +35,7 @@ public class DartFunction extends DartNode {
@Override
public void visitChildren(ASTVisitor<?> visitor) {
- visitor.visit(params);
+ parameters.accept(visitor);
if (body != null) {
body.accept(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698