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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartMethodDefinition.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 import com.google.dart.compiler.resolver.Element; 7 import com.google.dart.compiler.resolver.Element;
8 import com.google.dart.compiler.resolver.MethodNodeElement; 8 import com.google.dart.compiler.resolver.MethodNodeElement;
9 9
10 import java.util.Collections; 10 import java.util.Collections;
11 import java.util.List; 11 import java.util.List;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 this.element = (MethodNodeElement) element; 49 this.element = (MethodNodeElement) element;
50 } 50 }
51 51
52 public List<DartInitializer> getInitializers() { 52 public List<DartInitializer> getInitializers() {
53 return Collections.emptyList(); 53 return Collections.emptyList();
54 } 54 }
55 55
56 @Override 56 @Override
57 public void visitChildren(ASTVisitor<?> visitor) { 57 public void visitChildren(ASTVisitor<?> visitor) {
58 super.visitChildren(visitor); 58 super.visitChildren(visitor);
59 function.accept(visitor); 59 safelyVisitChild(function, visitor);
60 } 60 }
61 61
62 @Override 62 @Override
63 public <R> R accept(ASTVisitor<R> visitor) { 63 public <R> R accept(ASTVisitor<R> visitor) {
64 return visitor.visitMethodDefinition(this); 64 return visitor.visitMethodDefinition(this);
65 } 65 }
66 66
67 private static class DartMethodWithInitializersDefinition extends DartMethodDe finition { 67 private static class DartMethodWithInitializersDefinition extends DartMethodDe finition {
68 68
69 private final NodeList<DartInitializer> initializers = NodeList.create(this) ; 69 private final NodeList<DartInitializer> initializers = NodeList.create(this) ;
(...skipping 11 matching lines...) Expand all
81 return initializers; 81 return initializers;
82 } 82 }
83 83
84 @Override 84 @Override
85 public void visitChildren(ASTVisitor<?> visitor) { 85 public void visitChildren(ASTVisitor<?> visitor) {
86 super.visitChildren(visitor); 86 super.visitChildren(visitor);
87 initializers.accept(visitor); 87 initializers.accept(visitor);
88 } 88 }
89 } 89 }
90 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698