code: public static boolean isHoistedFunctionDeclaration(Node n) {
      if (isFunctionDeclaration(n)) {
        Node parent = n.getParent();
        return parent.isScript()
            || parent.isModuleBody()
            || parent.getParent().isFunction()
            || parent.isExport();
      }
      return false;
    }
docs: Is this node a hoisted function declaration? A function declaration in the
  scope root is hoisted to the top of the scope.
  See {@link #isFunctionDeclaration}).