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

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

Issue 10543051: Fix unparse for empty initializer or conditionStatement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | no next file » | 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 cf0911d10f4728d673d6c54d0471de76a8640fd3..a4bf8c8e6bcc333f0bc4f83a7ecb368f65ce13ea 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -76,8 +76,15 @@ class Unparser implements Visitor {
visitFor(For node) {
add(node.forToken.value);
sb.add('(');
- visit(node.initializer);
- visit(node.conditionStatement);
+ visitPart(part) {
Anton Muhin 2012/06/07 15:31:29 another option would be to yield empty statements
+ if (part === null) {
+ sb.add(';');
+ } else {
+ visit(part);
+ }
+ }
+ visitPart(node.initializer);
+ visitPart(node.conditionStatement);
visit(node.update);
sb.add(')');
visit(node.body);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698