Skip to content

Commit 1d8964e

Browse files
tomconnorsdnolen
authored andcommitted
CLJS-1770: goog-defines broken for integers
Using goog-define with integers caused cljs.closure/make-options to attempt to call a nonexistent method setDefineToIntegerLiteral. This fix causes all numeric goog-define and :closure-defines compiler options to use setDefineToDoubleLiteral.
1 parent 9245905 commit 1d8964e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/clojure/cljs/closure.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,7 @@
263263
(let [key (name key)]
264264
(cond
265265
(string? val) (.setDefineToStringLiteral compiler-options key val)
266-
(integer? val) (.setDefineToIntegerLiteral compiler-options key val)
267-
(float? val) (.setDefineToDoubleLiteral compiler-options key val)
266+
(number? val) (.setDefineToDoubleLiteral compiler-options key val)
268267
(or (true? val)
269268
(false? val)) (.setDefineToBooleanLiteral compiler-options key val)
270269
:else (println "value for" key "must be string, int, float, or bool"))))

0 commit comments

Comments
 (0)