Function: js--end-of-defun-nested

js--end-of-defun-nested is a byte-compiled function defined in js.el.gz.

Signature

(js--end-of-defun-nested)

Documentation

Helper function for js-end-of-defun.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
(defun js--end-of-defun-nested ()
  "Helper function for `js-end-of-defun'."
  (let* (pitem
         (this-end (save-excursion
                     (and (setq pitem (js--beginning-of-defun-nested))
                          (js--pitem-goto-h-end pitem)
                          (progn (backward-char)
                                 (forward-list)
                                 (point)))))
         found)

    (if (and this-end (< (point) this-end))
        ;; We're already inside a function; just go to its end.
        (goto-char this-end)

      ;; Otherwise, go to the end of the next function...
      (while (and (js--re-search-forward "\\_<function\\_>" nil t)
                  (not (setq found (progn
                                     (goto-char (match-beginning 0))
                                     (js--forward-function-decl))))))

      (if found (forward-list)
        ;; ... or eob.
        (goto-char (point-max))))))