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 9c7a23e6b727aa87a4e0287ae00ff88a23580d25..224153833020695e1231e4c6db6ced8cea47584d 100644 |
| --- a/lib/compiler/implementation/tree/unparser.dart |
| +++ b/lib/compiler/implementation/tree/unparser.dart |
| @@ -100,17 +100,27 @@ class Unparser implements Visitor { |
| // names are modelled with Send and it emits operator[] as only |
| // operator, without [] which are expected to be emitted with |
| // arguments. |
| + emitName(Identifier name) { |
| + final newName = renamer.renameIdentifier(name); |
|
Roman
2012/08/02 05:44:53
Looks like now renameIdentifier is only used for f
Anton Muhin
2012/08/03 13:57:57
It should be used for getters/setters, maybe even
|
| + if (newName === null) { |
| + visit(name); |
| + } else { |
| + sb.add(newName); |
| + } |
| + } |
| if (node.name is Send) { |
| Send send = node.name; |
| assert(send is !SendSet); |
| - visit(send.receiver); |
| if (!send.isOperator) { |
| // Looks like a factory method. |
| + emitName(send.receiver); |
| sb.add('.'); |
| + } else { |
| + visit(send.receiver); |
| } |
| visit(send.selector); |
| } else { |
| - visit(node.name); |
| + if (node.name !== null) emitName(node.name); |
| } |
| visit(node.parameters); |
| visit(node.initializers); |
| @@ -118,12 +128,7 @@ class Unparser implements Visitor { |
| } |
| visitIdentifier(Identifier node) { |
| - String newName = renamer.renameIdentifier(node); |
| - if (newName == null) { |
| - add(node.token.value); |
| - } else { |
| - sb.add(newName); |
| - } |
| + add(node.token.value); |
| } |
| visitIf(If node) { |