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

Unified Diff: sdk/lib/_internal/compiler/implementation/js/nodes.dart

Issue 11308156: Generate native class metadata as a JavaScript AST. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: 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));
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698