Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename 'separators' to 'js-separators'; see DJSON-9

  • Loading branch information...
commit 25a2a986490b2b2a5b84da6400fb5f2a987b9e90 1 parent 1b0d829
@stuartsierra stuartsierra authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/main/clojure/clojure/data/json.clj
18 src/main/clojure/clojure/data/json.clj
@@ -45,7 +45,7 @@
[(remove #{(codepoint \") (codepoint \\) (codepoint \/)}
(range 32 127))
- (= test :separators)
+ (= test :js-separators)
['(16r2028 16r2029) result]
[(int test) result]))
@@ -278,7 +278,7 @@
(def ^{:dynamic true :private true} *escape-unicode*)
-(def ^{:dynamic true :private true} *escape-separators*)
+(def ^{:dynamic true :private true} *escape-js-separators*)
(def ^{:dynamic true :private true} *escape-slash*)
(defprotocol JSONWriter
@@ -304,9 +304,9 @@
\return (.append sb "\\r")
\tab (.append sb "\\t")
;; Unicode characters that Javascript forbids raw in strings
- :separators (if *escape-separators*
- (.append sb (format "\\u%04x" cp))
- (.appendCodePoint sb cp))
+ :js-separators (if *escape-js-separators*
+ (.append sb (format "\\u%04x" cp))
+ (.appendCodePoint sb cp))
;; Any other character is Unicode
(if *escape-unicode*
(.append sb (format "\\u%04x" cp)) ; Hexadecimal-escaped
@@ -404,7 +404,7 @@
If true (default) non-ASCII characters are escaped as \\uXXXX
- :escape-separators boolean
+ :escape-js-separators boolean
If true (default) the Unicode characters U+2028 and U+2029 will
be escaped as \\u2028 and \\u2029 even if :escape-unicode is
@@ -436,14 +436,14 @@
returns itself, the key-value pair will be omitted from the
output. This option does not apply to non-map collections."
[x ^Writer writer & options]
- (let [{:keys [escape-unicode escape-separators escape-slash key-fn value-fn]
+ (let [{:keys [escape-unicode escape-js-separators escape-slash key-fn value-fn]
:or {escape-unicode true
- escape-separators true
+ escape-js-separators true
escape-slash true
key-fn default-write-key-fn
value-fn default-value-fn}} options]
(binding [*escape-unicode* escape-unicode
- *escape-separators* escape-separators
+ *escape-js-separators* escape-js-separators
*escape-slash* escape-slash
*key-fn* key-fn
*value-fn* value-fn]
Please sign in to comment.
Something went wrong with that request. Please try again.