]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/progmodes/js.el: Fix byte-compile warning.
authorYuan Fu <casouri@gmail.com>
Thu, 29 Dec 2022 19:34:28 +0000 (11:34 -0800)
committerYuan Fu <casouri@gmail.com>
Thu, 29 Dec 2022 19:34:51 +0000 (11:34 -0800)
lisp/progmodes/js.el

index 4dece11d1c1293051482d3ae9a5ac516c89267af..0cc673a80fff79ff9e18e2d3343b980232f3ab44 100644 (file)
@@ -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 _)