emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/compat 20afc89 78/99: Add :cond checks to json-* functi


From: ELPA Syncer
Subject: [elpa] externals/compat 20afc89 78/99: Add :cond checks to json-* functions in compat-27.1
Date: Sun, 17 Oct 2021 05:58:00 -0400 (EDT)

branch: externals/compat
commit 20afc898975b5136dca150391c41f20613a28e95
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Add :cond checks to json-* functions in compat-27.1
---
 compat-27.1.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/compat-27.1.el b/compat-27.1.el
index f9e22af..ddc94b3 100644
--- a/compat-27.1.el
+++ b/compat-27.1.el
@@ -171,6 +171,10 @@ represent a JSON false value.  It defaults to `:false'.
 In you specify the same value for `:null-object' and `:false-object',
 a potentially ambiguous situation, the JSON output will not contain
 any JSON false values."
+  :cond (condition-case nil
+            (json-parse-string "[]")
+          (json-unavailable t)
+          (void-function t))
   (require 'json)
   (let ((json-false (or (plist-get args :false-object) :false))
         (json-null (or (plist-get args :null-object) :null)))
@@ -181,6 +185,10 @@ any JSON false values."
 This is the same as (insert (json-serialize OBJECT)), but potentially
 faster.  See the function `json-serialize' for allowed values of
 OBJECT."
+  :cond (condition-case nil
+            (json-parse-string "[]")
+          (json-unavailable t)
+          (void-function t))
   (insert (apply #'compat--json-serialize object args)))
 
 (compat-defun json-parse-string (string &rest args)
@@ -207,6 +215,10 @@ to represent a JSON null value.  It defaults to `:null'.
 
 The keyword argument `:false-object' specifies which object to use to
 represent a JSON false value.  It defaults to `:false'."
+  :cond (condition-case nil
+            (json-parse-string "[]")
+          (json-unavailable t)
+          (void-function t))
   (require 'json)
   (condition-case err
       (let ((json-object-type (or (plist-get args :object-type) 'hash-table))
@@ -246,6 +258,10 @@ to represent a JSON null value.  It defaults to `:null'.
 
 The keyword argument `:false-object' specifies which object to use to
 represent a JSON false value.  It defaults to `:false'."
+  :cond (condition-case nil
+            (json-parse-string "[]")
+          (json-unavailable t)
+          (void-function t))
   (require 'json)
   (condition-case err
       (let ((json-object-type (or (plist-get args :object-type) 'hash-table))



reply via email to

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