summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-lib.el
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2021-02-11 12:00:05 +0000
committerBasil L. Contovounesios <contovob@tcd.ie>2021-02-21 12:53:45 +0000
commit908f251e19dc64c75000f87bc6db4e9a8852d1ad (patch)
tree4b3fd90665bca22fd75baedccfa72afb47b78342 /lisp/emacs-lisp/cl-lib.el
parent767608ef56044af63712206325d177b0caf279df (diff)
downloademacs-908f251e19dc64c75000f87bc6db4e9a8852d1ad.tar.gz
emacs-908f251e19dc64c75000f87bc6db4e9a8852d1ad.tar.bz2
emacs-908f251e19dc64c75000f87bc6db4e9a8852d1ad.zip
Fix json.el encoding of confusable object keys
* lisp/json.el (json-encode-string): Clarify commentary. (json--encode-stringlike): New function that covers a subset of json-encode. (json-encode-key): Use it for more efficient encoding and validation, and to avoid mishandling confusable keys like boolean symbols (bug#42545). (json-encode-array): Make it clearer that argument can be a list. (json-encode): Reuse json-encode-keyword and json--encode-stringlike for a subset of the dispatch logic. (json-pretty-print): Ensure confusable keys like ":a" survive a decoding/encoding roundtrip (bug#24252, bug#45032). * test/lisp/json-tests.el (test-json-encode-string) (test-json-encode-hash-table, test-json-encode-alist) (test-json-encode-plist, test-json-pretty-print-object): Test encoding of confusable keys.
Diffstat (limited to 'lisp/emacs-lisp/cl-lib.el')
0 files changed, 0 insertions, 0 deletions