Skip to content

Commit

Permalink
* if Long beyond bounds of JS integral values, emit BigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Sep 26, 2023
1 parent 7828149 commit 5477284
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/clojure/cljs/compiler.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,11 @@
(defmethod emit-constant* nil [x] (emits "null"))

#?(:clj
(defmethod emit-constant* Long [x] (emits "(" x ")")))
(defmethod emit-constant* Long [x]
(if (or (> x 9007199254740991)
(< x -9007199254740991))
(emits "(" x "n)")
(emits "(" x ")"))))

#?(:clj
(defmethod emit-constant* Integer [x] (emits x))) ; reader puts Integers in metadata
Expand Down

0 comments on commit 5477284

Please sign in to comment.