| OLD | NEW |
| 1 // Copyright (c) 2012, 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.common.AbstractNode; | 7 import com.google.dart.compiler.common.AbstractNode; |
| 8 import com.google.dart.compiler.resolver.Element; | 8 import com.google.dart.compiler.resolver.Element; |
| 9 import com.google.dart.compiler.type.Type; | 9 import com.google.dart.compiler.type.Type; |
| 10 import com.google.dart.compiler.util.DefaultTextOutput; | 10 import com.google.dart.compiler.util.DefaultTextOutput; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return super.toString(); | 110 return super.toString(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * If the given child is not <code>null</code>, use the given visitor to visit
it. | 114 * If the given child is not <code>null</code>, use the given visitor to visit
it. |
| 115 * | 115 * |
| 116 * @param child the child to be visited | 116 * @param child the child to be visited |
| 117 * @param visitor the visitor that will be used to visit the child | 117 * @param visitor the visitor that will be used to visit the child |
| 118 */ | 118 */ |
| 119 protected void safelyVisitChild(DartNode child, ASTVisitor<?> visitor) { | 119 protected void safelyVisitChild(DartNode child, ASTVisitor<?> visitor) { |
| 120 // Inline the DartIdentifier path - it's by far the most common. | 120 if (child != null) { |
| 121 if (child instanceof DartIdentifier) { | |
| 122 visitor.visitIdentifier((DartIdentifier)child); | |
| 123 } else if (child != null) { | |
| 124 child.accept(visitor); | 121 child.accept(visitor); |
| 125 } | 122 } |
| 126 } | 123 } |
| 127 | 124 |
| 128 } | 125 } |
| OLD | NEW |