src/com/google/javascript/jscomp/NodeUtil.java
/**
   * A pre-order traversal, calling Visitor.visit for each node in the tree. Children of nodes that
   * do not match the predicate will not be visited.
   */
A pre-order traversal, calling Visitor.visit for each node in the tree. Children of nodes that
do not match the predicate will not be visited.
A pre - order traversal calling Visitor . visit for each node in the tree . Children of nodes that do not match the predicate will not be visited .
public static void visitPreOrder(
      Node node, Visitor visitor, Predicate<Node> traverseChildrenPred) {
    visitor.visit(node);
    if (traverseChildrenPred.apply(node)) {
      for (Node c = node.getFirstChild(); c != null; c = c.getNext()) {
        visitPreOrder(c, visitor, traverseChildrenPred);
      }
    }
  }
public static void visitPreOrder ( Node node , Visitor visitor , Predicate < Node > traverseChildrenPred ) { visitor . visit ( node ) ; if ( traverseChildrenPred . apply ( node ) ) { for ( Node c = node . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { visitPreOrder ( c , visitor , traverseChildrenPred ) ; } } }
A pre-order traversal, calling Visitor.visit for each node in the tree.
A pre - order traversal calling Visitor . visit for each node in the tree .