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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartStringInterpolation.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/DartStringInterpolation.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartStringInterpolation.java b/compiler/java/com/google/dart/compiler/ast/DartStringInterpolation.java
index 2cc7a8586882b8b2eec3dabc37100bbfb0043df1..143f156699cc64d88c5a6abea04021a86a652583 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartStringInterpolation.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartStringInterpolation.java
@@ -20,18 +20,18 @@ public class DartStringInterpolation extends DartLiteral {
* adjacent expressions (e.g. $"${a} ${b}${c}" is represented by 4 strings
* ("", " ", "", "") and 3 expressions (#(){a}, #(){b}, #(){c}).
*/
- private List<DartStringLiteral> strings;
+ private final NodeList<DartStringLiteral> strings = NodeList.create(this);;
/** Embedded expressions (see {@link strings} for details). */
- private List<DartExpression> expressions;
+ private final NodeList<DartExpression> expressions = NodeList.create(this);
public DartStringInterpolation(List<DartStringLiteral> strings,
List<DartExpression> expressions) {
Preconditions.checkNotNull(strings);
Preconditions.checkNotNull(expressions);
Preconditions.checkArgument(strings.size() == expressions.size() + 1);
- this.strings = becomeParentOf(strings);
- this.expressions = becomeParentOf(expressions);
+ this.strings.addAll(strings);
+ this.expressions.addAll(expressions);
}
public List<DartStringLiteral> getStrings() {
@@ -44,8 +44,8 @@ public class DartStringInterpolation extends DartLiteral {
@Override
public void visitChildren(ASTVisitor<?> visitor) {
- visitor.visit(strings);
- visitor.visit(expressions);
+ strings.accept(visitor);
+ expressions.accept(visitor);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698