• Damien Cassou's avatar
    Fix pretty-printing empty objects as null · 8cb9beb3
    Damien Cassou authored
    * lisp/json.el (json-pretty-print): Force distinction between empty
      objects and null.
    (json-encode-list): Remove responsibility to print "null" as this
    value is not a list.
    (json-encode): Give higher precedence to lists so that an empty list
    is printed as an empty object, not as "null".
    * test/lisp/json-tests.el (test-json-encode): Add many tests to check
      the behavior of pretty-printing.
json.el 25.4 KB