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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartBlock.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/DartBlock.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartBlock.java b/compiler/java/com/google/dart/compiler/ast/DartBlock.java
index a081dfeaa1d0f4d2031f1b6faf1ac73574dd823b..e19edc01a73309c747921a3dc3977018f4f17b8b 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartBlock.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartBlock.java
@@ -11,19 +11,19 @@ import java.util.List;
*/
public class DartBlock extends DartStatement {
- private final List<DartStatement> stmts;
+ private final NodeList<DartStatement> statements = NodeList.create(this);
public DartBlock(List<DartStatement> statements) {
- this.stmts = becomeParentOf(statements);
+ this.statements.addAll(statements);
}
public List<DartStatement> getStatements() {
- return stmts;
+ return statements;
}
@Override
public boolean isAbruptCompletingStatement() {
- for (DartStatement stmt : stmts) {
+ for (DartStatement stmt : statements) {
if (stmt.isAbruptCompletingStatement()) {
return true;
}
@@ -33,7 +33,7 @@ public class DartBlock extends DartStatement {
@Override
public void visitChildren(ASTVisitor<?> visitor) {
- visitor.visit(stmts);
+ statements.accept(visitor);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698