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

Unified Diff: lib/compiler/implementation/tree/unparser.dart

Issue 11267046: [dart2dart] fix after https://codereview.chromium.org/11227007 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/compiler/implementation/dart_backend/renamer.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « lib/compiler/implementation/dart_backend/renamer.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698