From: Yuan Fu Date: Thu, 29 Dec 2022 19:34:28 +0000 (-0800) Subject: ; * lisp/progmodes/js.el: Fix byte-compile warning. X-Git-Tag: emacs-29.0.90~922 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=793641a3db5e14cd2eeb251d2f473b1035192560;p=emacs.git ; * lisp/progmodes/js.el: Fix byte-compile warning. --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 4dece11d1c1..0cc673a80ff 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -74,6 +74,8 @@ (declare-function treesit-node-start "treesit.c") (declare-function treesit-node-end "treesit.c") (declare-function treesit-node-type "treesit.c") +(declare-function treesit-query-compile "treesit.c") +(declare-function treesit-query-capture "treesit.c") ;;; Constants @@ -3642,8 +3644,9 @@ OVERRIDE is the override flag described in "call_expression"))) (defvar js--treesit-lhs-identifier-query - (treesit-query-compile 'javascript '((identifier) @id - (property_identifier) @id)) + (when (treesit-available-p) + (treesit-query-compile 'javascript '((identifier) @id + (property_identifier) @id))) "Query that captures identifier and query_identifier.") (defun js--treesit-fontify-assignment-lhs (node override start end &rest _)