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

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

Issue 24493006: Implement named arguments in InstanceMirror.invoke. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tweaked test to get a little test coverage Created 7 years, 3 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 | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/js/builder.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js/builder.dart b/dart/sdk/lib/_internal/compiler/implementation/js/builder.dart
index b0424c6195d64da54a0631b643dc072aeabd23dc..36433e82a3f8933fcbd778e56ed5e57309971904 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js/builder.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js/builder.dart
@@ -129,6 +129,14 @@ class JsBuilder {
throw new ArgumentError('expression should be an empty Map');
}
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++;
+ }
+ return new ArrayInitializer(values.length, values);
} else {
throw new ArgumentError('expression should be an Expression, '
'a String, a num, a bool, or a Map');
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698