Permalink
Browse files

Prevent reify from causing undeclared Var warnings

  • Loading branch information...
1 parent 9d696d9 commit 6b90cb700913160dd4af58c17fbf24eb8e91809f @michalmarczyk michalmarczyk committed with David Nolen May 2, 2012
Showing with 7 additions and 3 deletions.
  1. +1 −0 src/clj/cljs/compiler.clj
  2. +6 −3 src/clj/cljs/core.clj
@@ -16,6 +16,7 @@
(declare resolve-var)
(declare confirm-bindings)
+(declare munge)
(require 'cljs.core)
(def js-reserved
View
@@ -230,10 +230,13 @@
'default "_"})
(defmacro reify [& impls]
- (let [t (gensym "t")
- locals (keys (:locals &env))]
+ (let [t (gensym "t")
+ locals (keys (:locals &env))
+ ns (-> &env :ns :name)
+ munge cljs.compiler/munge
+ ns-t (list 'js* (core/str (munge ns) "." (munge t)))]
`(do
- (when (undefined? ~t)
+ (when (undefined? ~ns-t)
(deftype ~t [~@locals __meta#]
cljs.core.IWithMeta
(~'-with-meta [_# __meta#]

0 comments on commit 6b90cb7

Please sign in to comment.