Chromium Code Reviews| Index: lib/compiler/implementation/tree/unparser.dart |
| diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart |
| index 78d11c4ae490fec06b1bffc90f0f1216fae37540..8b3f03ad9df71e9609fec31fcbafdd89b8f78962 100644 |
| --- a/lib/compiler/implementation/tree/unparser.dart |
| +++ b/lib/compiler/implementation/tree/unparser.dart |
| @@ -82,6 +82,11 @@ class Unparser implements Visitor { |
| } |
| visitFunctionExpression(FunctionExpression node) { |
| + // Check length to not print unnecessary whitespace. |
| + if (node.modifiers !== null && node.modifiers.nodes.length() > 0) { |
|
Anton Muhin
2012/07/13 07:07:21
are both cases possible, both null and empty list?
Roman
2012/07/13 08:14:57
I added null check after I got "noSuchMethod" erro
Anton Muhin
2012/07/13 08:15:47
Thanks a lot for explanations, Roma.
On 2012/07/1
|
| + visit(node.modifiers); |
| + sb.add(' '); |
| + } |
| if (node.returnType !== null) { |
| visit(node.returnType); |
| sb.add(' '); |
| @@ -98,11 +103,16 @@ class Unparser implements Visitor { |
| Send send = node.name; |
| assert(send is !SendSet); |
| visit(send.receiver); |
| + if (!send.isOperator) { |
| + // Looks like a factory method. |
| + sb.add('.'); |
| + } |
| visit(send.selector); |
| } else { |
| visit(node.name); |
| } |
| visit(node.parameters); |
| + visit(node.initializers); |
| visit(node.body); |
| } |