| Index: lib/compiler/implementation/tree/unparser.dart
|
| diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
|
| index 9eb2794823a225543520dce9527115eec70bbba1..1f410c1657f0d3b561223f93fcbeda2736515cd4 100644
|
| --- a/lib/compiler/implementation/tree/unparser.dart
|
| +++ b/lib/compiler/implementation/tree/unparser.dart
|
| @@ -109,26 +109,13 @@ class Unparser implements Visitor {
|
| visit(node.function);
|
| }
|
|
|
| - visitFunctionExpression(FunctionExpression node) {
|
| - // Check length to not print unnecessary whitespace.
|
| - if (node.modifiers.nodes.length() > 0) {
|
| - visit(node.modifiers);
|
| - sb.add(' ');
|
| - }
|
| - if (node.returnType != null) {
|
| - visit(node.returnType);
|
| - sb.add(' ');
|
| - }
|
| - if (node.getOrSet != null) {
|
| - add(node.getOrSet.value);
|
| - sb.add(' ');
|
| - }
|
| + void unparseFunctionName(Node name) {
|
| // TODO(antonm): that's a workaround as currently FunctionExpression
|
| // names are modelled with Send and it emits operator[] as only
|
| // operator, without [] which are expected to be emitted with
|
| // arguments.
|
| - if (node.name is Send) {
|
| - Send send = node.name;
|
| + if (name is Send) {
|
| + Send send = name;
|
| assert(send is !SendSet);
|
| if (!send.isOperator) {
|
| // Looks like a factory method.
|
| @@ -146,8 +133,25 @@ class Unparser implements Visitor {
|
| }
|
| visit(send.selector);
|
| } else {
|
| - visit(node.name);
|
| + visit(name);
|
| + }
|
| + }
|
| +
|
| + visitFunctionExpression(FunctionExpression node) {
|
| + // Check length to not print unnecessary whitespace.
|
| + if (node.modifiers.nodes.length() > 0) {
|
| + visit(node.modifiers);
|
| + sb.add(' ');
|
| + }
|
| + if (node.returnType != null) {
|
| + visit(node.returnType);
|
| + sb.add(' ');
|
| + }
|
| + if (node.getOrSet != null) {
|
| + add(node.getOrSet.value);
|
| + sb.add(' ');
|
| }
|
| + unparseFunctionName(node.name);
|
| visit(node.parameters);
|
| visit(node.initializers);
|
| visit(node.body);
|
|
|