emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 793641a3db: ; * lisp/progmodes/js.el: Fix byte-compile warning.


From: Yuan Fu
Subject: emacs-29 793641a3db: ; * lisp/progmodes/js.el: Fix byte-compile warning.
Date: Thu, 29 Dec 2022 14:35:07 -0500 (EST)

branch: emacs-29
commit 793641a3db5e14cd2eeb251d2f473b1035192560
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; * lisp/progmodes/js.el: Fix byte-compile warning.
---
 lisp/progmodes/js.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 4dece11d1c..0cc673a80f 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 _)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]