+(defun js2-imenu-parent-key-names (node)\r
+ "Get the list of parent key names of NODE.\r
+\r
+For example, for code\r
+\r
+ {rules: {password: {required: function() {}}}}\r
+\r
+when NODE is the inner `js2-object-prop-mode',\r
+it returns `(\"rules\" \"password\")'."\r
+ (let (rlt (n node))\r
+ (while (setq n (js2-imenu-parent-prop-node n))\r
+ (push (js2-prop-node-name (js2-object-prop-node-left n)) rlt))\r
+ rlt))\r
+\r
+(defun js2-imenu-parent-prop-node (node)\r
+ "When the parent of NODE is `js2-object-node',\r
+and the grandparent is `js2-object-prop-node',\r
+return the grandparent."\r
+ ;; Suppose the code is:\r
+ ;; {parent-key: {required: function() {}}}\r
+ ;; NODE is `required: function() {}'.\r
+ (let (p2 p3)\r
+ ;; Parent is `{required: function() {}}'.\r
+ (setq p2 (js2-node-parent node))\r
+ ;; GP is `parent-key: {required: function() {}}'.\r
+ (when (and p2 (js2-object-node-p p2))\r
+ (setq p3 (js2-node-parent p2))\r
+ (if (and p3 (js2-object-prop-node-p p3)) p3))))\r
+\r