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

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

Issue 10583016: Add a test for operator[] unparse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Ready for review version Created 8 years, 6 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 | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | tests/compiler/dart2js/unparser_test.dart » ('J')
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 67df031e46cd78c9fe67c3c20cac0b7aaf25dcf6..1f44f4d39cb325276594c2396c0a61b139c453c9 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -87,6 +87,11 @@ class Unparser implements Visitor {
sb.add(' ');
}
visit(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 && node.name.isIndex) sb.add('[]');
ahe 2012/06/19 16:42:45 Actually, I think this would be slightly cleaner:
Anton Muhin 2012/06/19 18:02:05 Done.
visit(node.parameters);
visit(node.body);
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | tests/compiler/dart2js/unparser_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698