Function: js--guess-eval-defun-info
js--guess-eval-defun-info is a byte-compiled function defined in
js.el.gz.
Signature
(js--guess-eval-defun-info PSTATE)
Documentation
Helper function for js-eval-defun.
Return a list (NAME . CLASSPARTS), where CLASSPARTS is a list of strings making up the class name and NAME is the name of the function part.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
(defun js--guess-eval-defun-info (pstate)
"Helper function for `js-eval-defun'.
Return a list (NAME . CLASSPARTS), where CLASSPARTS is a list of
strings making up the class name and NAME is the name of the
function part."
(cond ((and (= (length pstate) 3)
(eq (js--pitem-type (cl-first pstate)) 'function)
(= (length (js--pitem-name (cl-first pstate))) 1)
(consp (js--pitem-type (cl-second pstate))))
(append (js--pitem-name (cl-second pstate))
(list (cl-first (js--pitem-name (cl-first pstate))))))
((and (= (length pstate) 2)
(eq (js--pitem-type (cl-first pstate)) 'function))
(append
(butlast (js--pitem-name (cl-first pstate)))
(list (car (last (js--pitem-name (cl-first pstate)))))))
(t (error "Function not a toplevel defun or class member"))))