code: static boolean isDefinedValue(Node value) {
      switch (value.getToken()) {
        case ASSIGN: // Only the assigned value matters here.
        case CAST:
        case COMMA:
          return isDefinedValue(value.getLastChild());
        case AND:
        case OR:
          return isDefinedValue(value.getFirstChild())
              && isDefinedValue(value.getLastChild());
        case HOOK:
          return isDefinedValue(value.getSecondChild())
              && isDefinedValue(value.getLastChild());
        // Assume undefined leaks in this and call results.
        case CALL:
        case NEW:
        case GETELEM:
        case GETPROP:
        case TAGGED_TEMPLATELIT:
        case THIS:
        case YIELD:
        case AWAIT:
        case VOID:
          return false;
        case DELPROP:
        case INC:
        case DEC:
        case CLASS:
        case FUNCTION:
        case REGEXP:
        case EMPTY:
        case ARRAYLIT:
        case OBJECTLIT:
        case TEMPLATELIT:
        case STRING:
        case NUMBER:
        case NULL:
        case TRUE:
        case FALSE:
          return true;
        case TEMPLATELIT_STRING:
          return value.getCookedString() != null;
        case NAME:
          String name = value.getString();
          // We assume here that programs don't change the value of the keyword
          // undefined to something other than the value undefined.
          return "Infinity".equals(name) || "NaN".equals(name);
        default:
          // Other op force a local value:
          //  '' + g (a  string)
          //  x -= g (x is now an number)
          if (isAssignmentOp(value) || isSimpleOperator(value)) {
            return true;
          }
  
          throw new IllegalStateException(
              "Unexpected expression node: " + value + "\n parent:" + value.getParent());
      }
    }
docs: @return Whether the provided expression is known not to evaluate to 'undefined'.
  
  Similar to #getKnownValueType only for 'undefined'.  This is useful for simplifying
  default value expressions.