src/com/google/javascript/jscomp/NodeUtil.java
/**
   * Determines whether this node is testing for the existence of a property.
   * If true, we will not emit warnings about a missing property.
   *
   * @param propAccess The GETPROP or GETELEM being tested.
   */
Determines whether this node is testing for the existence of a property.
If true, we will not emit warnings about a missing property.

@param propAccess The GETPROP or GETELEM being tested.
Determines whether this node is testing for the existence of a property . If true we will not emit warnings about a missing property . @param propAccess The GETPROP or GETELEM being tested .
static boolean isPropertyTest(AbstractCompiler compiler, Node propAccess) {
    Node parent = propAccess.getParent();
    switch (parent.getToken()) {
      case CALL:
        return parent.getFirstChild() != propAccess
            && compiler.getCodingConvention().isPropertyTestFunction(parent);
      case IF:
      case WHILE:
      case DO:
      case FOR:
      case FOR_IN:
        return NodeUtil.getConditionExpression(parent) == propAccess;
      case INSTANCEOF:
      case TYPEOF:
      case AND:
      case OR:
        return true;
      case NE:
      case SHNE: {
        Node other = parent.getFirstChild() == propAccess
            ? parent.getSecondChild() : parent.getFirstChild();
        return isUndefined(other);
      }
      case HOOK:
        return parent.getFirstChild() == propAccess;
      case NOT:
        return parent.getParent().isOr()
            && parent.getParent().getFirstChild() == parent;
      case CAST:
        return isPropertyTest(compiler, parent);
      default:
        break;
    }
    return false;
  }
static boolean isPropertyTest ( AbstractCompiler compiler , Node propAccess ) { Node parent = propAccess . getParent ( ) ; switch ( parent . getToken ( ) ) { case CALL : return parent . getFirstChild ( ) != propAccess && compiler . getCodingConvention ( ) . isPropertyTestFunction ( parent ) ; case IF : case WHILE : case DO : case FOR : case FOR_IN : return NodeUtil . getConditionExpression ( parent ) == propAccess ; case INSTANCEOF : case TYPEOF : case AND : case OR : return true ; case NE : case SHNE : { Node other = parent . getFirstChild ( ) == propAccess ? parent . getSecondChild ( ) : parent . getFirstChild ( ) ; return isUndefined ( other ) ; } case HOOK : return parent . getFirstChild ( ) == propAccess ; case NOT : return parent . getParent ( ) . isOr ( ) && parent . getParent ( ) . getFirstChild ( ) == parent ; case CAST : return isPropertyTest ( compiler , parent ) ; default : break ; } return false ; }
Determines whether this node is testing for the existence of a property.
Determines whether this node is testing for the existence of a property .