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

Unified Diff: lib/src/js/template.dart

Issue 1183033004: js_ast: implement rest/spread parsing (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 | « lib/src/js/printer.dart ('k') | tool/input_sdk/private/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/template.dart
diff --git a/lib/src/js/template.dart b/lib/src/js/template.dart
index 9551b7f4694670ca19c30989502ca25e815e9f68..0c951a968d09456e7ae8a20d8a4ca635c895d14a 100644
--- a/lib/src/js/template.dart
+++ b/lib/src/js/template.dart
@@ -639,6 +639,12 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
Instantiator visitIdentifier(Identifier node) =>
(arguments) => new Identifier(node.name);
+ Instantiator visitSpread(Spread node) =>
+ (args) => new Spread(visit(node.argument)(args));
+
+ Instantiator visitRestParameter(RestParameter node) =>
+ (args) => new RestParameter(visit(node.parameter)(args));
+
Instantiator visitAccess(PropertyAccess node) {
Instantiator makeReceiver = visit(node.receiver);
Instantiator makeSelector = visit(node.selector);
@@ -658,7 +664,7 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
Instantiator makeBody = visit(node.body);
// TODO(sra): Avoid copying params if no interpolation or forced copying.
return (arguments) {
- List<Identifier> params = <Identifier>[];
+ List<Parameter> params = <Parameter>[];
for (Instantiator instantiator in paramMakers) {
var result = instantiator(arguments);
if (result is Iterable) {
« no previous file with comments | « lib/src/js/printer.dart ('k') | tool/input_sdk/private/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698