Permalink
Browse files

Avoid clojure.lang.BigInt as literal to support 1.2.x

  • Loading branch information...
1 parent b4c7b4d commit 41fee9ab111798a89dc2b2782a2b838f41956e1e @stuartsierra stuartsierra committed Oct 26, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/clojure/clojure/data/json.clj
@@ -366,10 +366,10 @@
(extend java.math.BigInteger JSONWriter {:-write write-bignum})
(extend java.math.BigDecimal JSONWriter {:-write write-bignum})
;; Attempt to support Clojure 1.2.x:
-(when (try (.. Thread currentThread getContextClassLoader
- (loadClass "clojure.lang.BigInt"))
- (catch ClassNotFoundException _ false))
- (extend clojure.lang.BigInt JSONWriter {:-write write-bignum}))
+(when-let [class (try (.. Thread currentThread getContextClassLoader
+ (loadClass "clojure.lang.BigInt"))
+ (catch ClassNotFoundException _ false))]
+ (extend class JSONWriter {:-write write-bignum}))
;; Symbols, Keywords, and Strings

0 comments on commit 41fee9a

Please sign in to comment.