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

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

Issue 10702054: Issue 3931. Visit children nodes safely. (Closed) Base URL: https://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) 2012, 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 an entry in a Dart map literal value. 8 * Represents an entry in a Dart map literal value.
9 */ 9 */
10 public class DartMapLiteralEntry extends DartNode { 10 public class DartMapLiteralEntry extends DartNode {
11 11
12 private DartExpression key; 12 private DartExpression key;
13 private DartExpression value; 13 private DartExpression value;
14 14
15 public DartMapLiteralEntry(DartExpression key, DartExpression value) { 15 public DartMapLiteralEntry(DartExpression key, DartExpression value) {
16 this.key = becomeParentOf(key); 16 this.key = becomeParentOf(key);
17 this.value = becomeParentOf(value); 17 this.value = becomeParentOf(value);
18 } 18 }
19 19
20 public DartExpression getKey() { 20 public DartExpression getKey() {
21 return key; 21 return key;
22 } 22 }
23 23
24 public DartExpression getValue() { 24 public DartExpression getValue() {
25 return value; 25 return value;
26 } 26 }
27 27
28 @Override 28 @Override
29 public void visitChildren(ASTVisitor<?> visitor) { 29 public void visitChildren(ASTVisitor<?> visitor) {
30 key.accept(visitor); 30 safelyVisitChild(key, visitor);
31 value.accept(visitor); 31 safelyVisitChild(value, visitor);
32 } 32 }
33 33
34 @Override 34 @Override
35 public <R> R accept(ASTVisitor<R> visitor) { 35 public <R> R accept(ASTVisitor<R> visitor) {
36 return visitor.visitMapLiteralEntry(this); 36 return visitor.visitMapLiteralEntry(this);
37 } 37 }
38 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698