Skip to content

Commit

Permalink
Skip 'this' nodes when building imenu index (regression)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov committed Jan 13, 2012
1 parent 510650b commit b748c26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js2-mode.el
Expand Up @@ -6913,11 +6913,13 @@ For instance, processing a nested scope requires a parent function node."
(let (result head fn current-fn parent-qname qname p elem)
(dolist (entry entries)
;; function node goes first
(destructuring-bind (current-fn &rest chain) entry
(destructuring-bind (current-fn &rest (&whole chain head &rest)) entry
;; examine its defining scope;
;; if top-level/external, keep as-is
(if (js2-node-top-level-decl-p (car chain))
(if (js2-node-top-level-decl-p head)
(push chain result)
(when (js2-this-node-p head)
(setq chain (cdr chain))) ; discard this-node
(when (setq fn (js2-node-parent-script-or-fn current-fn))
(setq parent-qname (gethash fn js2-imenu-function-map 'not-found))
(when (eq parent-qname 'not-found)
Expand Down

0 comments on commit b748c26

Please sign in to comment.