test/com/google/javascript/jscomp/ExpressionDecomposerTest.java
/**
   * @param name The name to look for. If name is null, look for a yield expression instead.
   * @param call The call to look for.
   * @return The return the Nth instance of the CALL/YIELD node
   * matching name found in a pre-order traversal.
   */
@param name The name to look for. If name is null, look for a yield expression instead.
@param call The call to look for.
@return The return the Nth instance of the CALL/YIELD node
matching name found in a pre-order traversal.
@param name The name to look for . If name is null look for a yield expression instead . @param call The call to look for . @return The return the Nth instance of the CALL / YIELD node matching name found in a pre - order traversal .
private static Node findCall(
      Node root, @Nullable final String name, final int call) {
    class Find {
      int found = 0;
      Node find(Node n) {
        if (n.isCall() || n.isYield()) {
          if (name == null
              || (n.isYield() && "yield".equals(name))
              || (n.isCall() && n.getFirstChild().matchesQualifiedName(name))) {
            found++;
            if (found == call) {
              return n;
            }
          }
        }
        for (Node c : n.children()) {
          Node result = find(c);
          if (result != null) {
            return result;
          }
        }
        return null;
      }
    }
    return (new Find()).find(root);
  }
private static Node findCall ( Node root , @ Nullable final String name , final int call ) { class Find { int found = 0 ; Node find ( Node n ) { if ( n . isCall ( ) || n . isYield ( ) ) { if ( name == null || ( n . isYield ( ) && "yield" . equals ( name ) ) || ( n . isCall ( ) && n . getFirstChild ( ) . matchesQualifiedName ( name ) ) ) { found ++ ; if ( found == call ) { return n ; } } } for ( Node c : n . children ( ) ) { Node result = find ( c ) ; if ( result != null ) { return result ; } } return null ; } } return ( new Find ( ) ) . find ( root ) ; }
@param name The name to look for.
@param name The name to look for .