| Index: compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
|
| diff --git a/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java b/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
|
| index 2d4d80a536a7ff813d670e82ec7b209fbd0475a4..57fd177b9d624022ecbb1a49456769ba759d4853 100644
|
| --- a/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
|
| +++ b/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
|
| @@ -255,7 +255,12 @@ public class DartToSourceVisitor extends ASTVisitor<Void> {
|
| p(")");
|
| }
|
| if (x.getDefaultExpr() != null) {
|
| - p(" = ");
|
| + if (x.getModifiers().isOptional()) {
|
| + p(" = ");
|
| + }
|
| + if (x.getModifiers().isNamed()) {
|
| + p(" : ");
|
| + }
|
| accept(x.getDefaultExpr());
|
| }
|
| return null;
|
| @@ -348,21 +353,28 @@ public class DartToSourceVisitor extends ASTVisitor<Void> {
|
| }
|
|
|
| private void pFormalParameters(List<DartParameter> params) {
|
| - boolean first = true, hasNamed = false;
|
| + boolean first = true, hasPositional = false, hasNamed = false;
|
| for (DartParameter param : params) {
|
| if (!first) {
|
| p(", ");
|
| }
|
| + if (!hasPositional && param.getModifiers().isOptional()) {
|
| + hasPositional = true;
|
| + p("[");
|
| + }
|
| if (!hasNamed && param.getModifiers().isNamed()) {
|
| hasNamed = true;
|
| - p("[");
|
| + p("{");
|
| }
|
| accept(param);
|
| first = false;
|
| }
|
| - if (hasNamed) {
|
| + if (hasPositional) {
|
| p("]");
|
| }
|
| + if (hasNamed) {
|
| + p("}");
|
| + }
|
| }
|
|
|
| @Override
|
|
|