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

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

Issue 10945032: Force a space after empty list literal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/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 972e41860049cf9daf5cc6f9f2661af09e011e86..221a5e59ffe6496027adc12380ec3c88ffdce83d 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -220,6 +220,8 @@ class Unparser implements Visitor {
if (node.constKeyword !== null) add(node.constKeyword.value);
visit(node.typeArguments);
visit(node.elements);
+ // If list is empty, emit space after [] to disambiguate cases like []==[].
+ if (node.elements.isEmpty()) sb.add(' ');
}
visitModifiers(Modifiers node) => node.visitChildren(this);
« no previous file with comments | « no previous file | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698