diff options
| -rw-r--r-- | lisp/json.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/json.el b/lisp/json.el index 3def94ce042..627e65efa45 100644 --- a/lisp/json.el +++ b/lisp/json.el | |||
| @@ -193,8 +193,7 @@ Unlike `reverse', this keeps the property-value pairs intact." | |||
| 193 | 193 | ||
| 194 | (defsubst json-peek () | 194 | (defsubst json-peek () |
| 195 | "Return the character at point." | 195 | "Return the character at point." |
| 196 | (let ((char (char-after (point)))) | 196 | (or (char-after (point)) :json-eof)) |
| 197 | (or char :json-eof))) | ||
| 198 | 197 | ||
| 199 | (defsubst json-pop () | 198 | (defsubst json-pop () |
| 200 | "Advance past the character at point, returning it." | 199 | "Advance past the character at point, returning it." |
| @@ -415,7 +414,7 @@ representation will be parsed correctly." | |||
| 415 | ;; Skip over the '"' | 414 | ;; Skip over the '"' |
| 416 | (json-advance) | 415 | (json-advance) |
| 417 | (if characters | 416 | (if characters |
| 418 | (apply 'string (nreverse characters)) | 417 | (concat (nreverse characters)) |
| 419 | ""))) | 418 | ""))) |
| 420 | 419 | ||
| 421 | ;; String encoding | 420 | ;; String encoding |
| @@ -639,7 +638,9 @@ become JSON objects." | |||
| 639 | (signal 'json-error (list 'bleah))))) | 638 | (signal 'json-error (list 'bleah))))) |
| 640 | ;; Skip over the "]" | 639 | ;; Skip over the "]" |
| 641 | (json-advance) | 640 | (json-advance) |
| 642 | (apply json-array-type (nreverse elements)))) | 641 | (pcase json-array-type |
| 642 | (`vector (nreverse (vconcat elements))) | ||
| 643 | (`list (nreverse elements))))) | ||
| 643 | 644 | ||
| 644 | ;; Array encoding | 645 | ;; Array encoding |
| 645 | 646 | ||