Function: js--forward-function-decl
js--forward-function-decl is a byte-compiled function defined in
js.el.gz.
Signature
(js--forward-function-decl)
Documentation
Move forward over a JavaScript function declaration.
This puts point at the function keyword.
If this is a syntactically-correct non-expression function, return the name of the function, or t if the name could not be determined. Otherwise, return nil.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
(defun js--forward-function-decl ()
"Move forward over a JavaScript function declaration.
This puts point at the `function' keyword.
If this is a syntactically-correct non-expression function,
return the name of the function, or t if the name could not be
determined. Otherwise, return nil."
(cl-assert (looking-at "\\_<function\\_>"))
(let ((name t))
(forward-word-strictly)
(forward-comment most-positive-fixnum)
(when (eq (char-after) ?*)
(forward-char)
(forward-comment most-positive-fixnum))
(when (looking-at js--name-re)
(setq name (match-string-no-properties 0))
(goto-char (match-end 0)))
(forward-comment most-positive-fixnum)
(and (eq (char-after) ?\( )
(ignore-errors (forward-list) t)
(progn (forward-comment most-positive-fixnum)
(and (eq (char-after) ?{)
name)))))