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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartTryStatement.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/DartTryStatement.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartTryStatement.java b/compiler/java/com/google/dart/compiler/ast/DartTryStatement.java
index 3f3dcf07690ff809543e401bd4209154b860c369..4357f92fffdfe46a6dcebe8aefb016a7096b68c2 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartTryStatement.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartTryStatement.java
@@ -12,13 +12,13 @@ import java.util.List;
public class DartTryStatement extends DartStatement {
private DartBlock tryBlock;
- private List<DartCatchBlock> catchBlocks;
+ private final NodeList<DartCatchBlock> catchBlocks = NodeList.create(this);
private DartBlock finallyBlock;
public DartTryStatement(DartBlock tryBlock, List<DartCatchBlock> catchBlocks,
DartBlock finallyBlock) {
this.tryBlock = becomeParentOf(tryBlock);
- this.catchBlocks = becomeParentOf(catchBlocks);
+ this.catchBlocks.addAll(catchBlocks);
this.finallyBlock = becomeParentOf(finallyBlock);
}
@@ -37,7 +37,7 @@ public class DartTryStatement extends DartStatement {
@Override
public void visitChildren(ASTVisitor<?> visitor) {
tryBlock.accept(visitor);
- visitor.visit(catchBlocks);
+ catchBlocks.accept(visitor);
if (finallyBlock != null) {
finallyBlock.accept(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698