Skip to content

Commit

Permalink
Fix JVM compat
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 6, 2023
1 parent 77bd61e commit 09f2e1d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/squint/compiler.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
gensym (:gensym env)
local (gensym)
env (update env :var->ident assoc local local)]
(str (emit (list 'js* (str/replace "for (let %s of ~{})" "%s" local)
(str (emit (list 'js* (str/replace "for (let %s of ~{})" "%s" (str local))
(list 'clojure.core/iterable v))
env)
" {\n"
Expand Down Expand Up @@ -377,10 +377,12 @@
:top-level true
:core-vars core-vars
:gensym (let [ctr (volatile! 0)]
(fn [sym]
(let [next-id (vswap! ctr inc)]
(symbol (str (if sym (munge sym)
"G__") next-id)))))
(fn gensym*
([] (gensym* nil))
([sym]
(let [next-id (vswap! ctr inc)]
(symbol (str (if sym (munge sym)
"G__") next-id))))))
:emit {::cc/list emit-list
::cc/vector emit-vector
::cc/map emit-map
Expand Down

0 comments on commit 09f2e1d

Please sign in to comment.