Index: sdk/lib/_internal/compiler/implementation/js/nodes.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js/nodes.dart b/sdk/lib/_internal/compiler/implementation/js/nodes.dart |
index 18139b29fd32709ad4cf4a49af5f6e378f4e878b..8e1256596fbdd346aaf30d83ad649a1186269d96 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js/nodes.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js/nodes.dart |
@@ -769,6 +769,9 @@ class ArrayInitializer extends Expression { |
ArrayInitializer(this.length, this.elements); |
+ factory ArrayInitializer.from(List<Expression> expressions) => |
+ new ArrayInitializer(expressions.length, _convert(expressions)); |
+ |
accept(NodeVisitor visitor) => visitor.visitArrayInitializer(this); |
void visitChildren(NodeVisitor visitor) { |
@@ -776,6 +779,12 @@ class ArrayInitializer extends Expression { |
} |
int get precedenceLevel => PRIMARY; |
+ |
+ static List<ArrayElement> _convert(List<Expression> expressions) { |
ngeoffray
2012/11/22 08:49:47
List<ArrayElement> is kind of not true.
|
+ int index = 0; |
+ return expressions.map( |
+ (expression) => new ArrayElement(index++, expression)); |
+ } |
} |
/** |