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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartDoWhileStatement.java

Issue 10696056: Fix for issues 3729 and 3523 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler.ast; 5 package com.google.dart.compiler.ast;
6 6
7 /** 7 /**
8 * Represents a Dart 'do/while' statement. 8 * Represents a Dart 'do/while' statement.
9 */ 9 */
10 public class DartDoWhileStatement extends DartStatement { 10 public class DartDoWhileStatement extends DartStatement {
11 11
12 private DartExpression condition; 12 private DartExpression condition;
13 private DartStatement body; 13 private DartStatement body;
14 14
15 public DartDoWhileStatement(DartExpression condition, DartStatement body) { 15 public DartDoWhileStatement(DartExpression condition, DartStatement body) {
16 this.condition = becomeParentOf(condition); 16 this.condition = becomeParentOf(condition);
17 this.body = becomeParentOf(body); 17 this.body = becomeParentOf(body);
18 } 18 }
19 19
20 public DartStatement getBody() { 20 public DartStatement getBody() {
21 return body; 21 return body;
22 } 22 }
23 23
24 public DartExpression getCondition() { 24 public DartExpression getCondition() {
25 return condition; 25 return condition;
26 } 26 }
27 27
28 @Override 28 @Override
29 public void visitChildren(ASTVisitor<?> visitor) { 29 public void visitChildren(ASTVisitor<?> visitor) {
30 condition.accept(visitor); 30 if (condition != null) {
31 condition.accept(visitor);
32 }
31 body.accept(visitor); 33 body.accept(visitor);
32 } 34 }
33 35
34 @Override 36 @Override
35 public <R> R accept(ASTVisitor<R> visitor) { 37 public <R> R accept(ASTVisitor<R> visitor) {
36 return visitor.visitDoWhileStatement(this); 38 return visitor.visitDoWhileStatement(this);
37 } 39 }
38 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698