branch: master commit d3b31baf68acd1b7e0d05582e504c44e1a587be7 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@yandex.ru>
js2-node-qname-component: Nandle computed properties Fixes #408. --- js2-mode.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js2-mode.el b/js2-mode.el index 24be8e8..a6f156a 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -7490,9 +7490,12 @@ returns nil. Otherwise returns the string name/value of the node." Returns nil if the node doesn't contribute." (copy-sequence (or (js2-prop-node-name node) - (if (and (js2-function-node-p node) - (js2-function-node-name node)) - (js2-name-node-name (js2-function-node-name node)))))) + (cond + ((and (js2-function-node-p node) + (js2-function-node-name node)) + (js2-name-node-name (js2-function-node-name node))) + ((js2-computed-prop-name-node-p node) + "[computed]"))))) (defun js2-record-imenu-entry (fn-node qname pos) "Add an entry to `js2-imenu-recorder'.