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

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

Issue 160343002: Implement reflection on annotations of parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 6 years, 10 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/builder.dart b/sdk/lib/_internal/compiler/implementation/js/builder.dart
index 8958b50fcc2f3b6cc5a191684b8fd5b5764d60d4..634444719f15e4714942864742351fc7126cd89b 100644
--- a/sdk/lib/_internal/compiler/implementation/js/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js/builder.dart
@@ -126,16 +126,12 @@ class JsBuilder {
}
return new ObjectInitializer([]);
} else if (expression is List) {
- var values = new List<ArrayElement>(expression.length);
- int index = 0;
- for (var entry in expression) {
- values[index] = new ArrayElement(index, toExpression(entry));
- index++;
- }
+ var values = new List<ArrayElement>.generate(expression.length,
+ (index) => new ArrayElement(index, toExpression(expression[index])));
return new ArrayInitializer(values.length, values);
} else {
throw new ArgumentError('expression should be an Expression, '
- 'a String, a num, a bool, or a Map');
+ 'a String, a num, a bool, a Map, or a List;');
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698