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

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

Issue 1069493002: implement opassign, fix bugs in pre/postfix, introduce a let* helper (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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/nodes.dart ('k') | lib/src/js/template.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/printer.dart
diff --git a/lib/src/js/printer.dart b/lib/src/js/printer.dart
index 594916d4db26f62be3769a570921245402f08e89..a1a68c450d2b1cf04024373b9b1f8f27091dc4cf 100644
--- a/lib/src/js/printer.dart
+++ b/lib/src/js/printer.dart
@@ -828,17 +828,21 @@ class Printer implements NodeVisitor {
out("(");
}
localNamer.enterScope(fun);
- out("(");
- if (fun.params != null) {
+ if (fun.params.length == 1) {
+ visitNestedExpression(fun.params.single, PRIMARY,
+ newInForInit: false, newAtStatementBegin: false);
+ } else {
+ out("(");
visitCommaSeparated(fun.params, PRIMARY,
newInForInit: false, newAtStatementBegin: false);
+ out(")");
}
- out(")");
spaceOut();
out("=>");
if (fun.body is Expression) {
spaceOut();
- fun.body.accept(this);
+ visitNestedExpression(fun.body, ASSIGNMENT,
+ newInForInit: false, newAtStatementBegin: false);
} else {
blockBody(fun.body, needsSeparation: false, needsNewline: false);
}
« no previous file with comments | « lib/src/js/nodes.dart ('k') | lib/src/js/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698