code: @Nullable
    private static Node findExpressionRoot(Node subExpression) {
      Node child = subExpression;
      for (Node current : child.getAncestors()) {
        Node parent = current.getParent();
        switch (current.getToken()) {
            // Supported expression roots:
            // SWITCH and IF can have multiple children, but the CASE, DEFAULT,
            // or BLOCK will be encountered first for any of the children other
            // than the condition.
          case EXPR_RESULT:
          case IF:
          case SWITCH:
          case RETURN:
          case THROW:
            Preconditions.checkState(child.isFirstChildOf(current));
            return current;
  
          case VAR:
            // Normalization will remove LABELs from VARs.
          case LET:
          case CONST:
            if (NodeUtil.isAnyFor(parent)) {
              break; // Name declarations may not be roots if they're for-loop initializers.
            }
            return current;
  
            // Any of these indicate an unsupported expression:
          case FOR:
            if (child.isFirstChildOf(current)) {
              // Only the initializer of a for-loop could possibly be decomposed since the other
              // statements need to execute each iteration.
              return current;
            }
            // fall through
          case FOR_IN:
          case FOR_OF:
          case FOR_AWAIT_OF:
          case DO:
          case WHILE:
          case SCRIPT:
          case BLOCK:
          case LABEL:
          case CASE:
          case DEFAULT_CASE:
          case PARAM_LIST:
            return null;
  
          default:
            break;
        }
        child = current;
      }
  
      throw new IllegalStateException("Unexpected AST structure.");
    }
docs: Finds the statement containing {@code subExpression}.
  
  <p>If {@code subExpression} is not contained by a statement where inlining is known to be
  possible, {@code null} is returned. For example, the condition expression of a WHILE loop.