| Index: compiler/java/com/google/dart/compiler/ast/DartNode.java
|
| diff --git a/compiler/java/com/google/dart/compiler/ast/DartNode.java b/compiler/java/com/google/dart/compiler/ast/DartNode.java
|
| index cfb8830bd544ece709b3b925694bb3751ade92fb..736882285e84743e399e7ab5ec71df7d7eace1d6 100644
|
| --- a/compiler/java/com/google/dart/compiler/ast/DartNode.java
|
| +++ b/compiler/java/com/google/dart/compiler/ast/DartNode.java
|
| @@ -109,5 +109,17 @@ public abstract class DartNode extends AbstractNode {
|
| public String getObjectIdentifier(){
|
| return super.toString();
|
| }
|
| +
|
| + /**
|
| + * If the given child is not <code>null</code>, use the given visitor to visit it.
|
| + *
|
| + * @param child the child to be visited
|
| + * @param visitor the visitor that will be used to visit the child
|
| + */
|
| + protected void safelyVisitChild(DartNode child, ASTVisitor<?> visitor) {
|
| + if (child != null) {
|
| + child.accept(visitor);
|
| + }
|
| + }
|
|
|
| }
|
|
|