Browse files

CLJS-397 var reads in a :statement context get omitted

This is done so that google closure can optimize away unused deftypes.
  • Loading branch information...
1 parent e83204a commit 97e5fbd1e1597d58be35fd8320c8044ccc9d3a3d @bendlas bendlas committed with David Nolen Oct 22, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/clj/cljs/compiler.clj
3 src/clj/cljs/compiler.clj
@@ -213,7 +213,8 @@
n (if (= (namespace n) "js")
(name n)
- (emit-wrap env (emits (munge n)))))
+ (when-not (= :statement (:context env))
+ (emit-wrap env (emits (munge n))))))
(defmethod emit :meta
[{:keys [expr meta env]}]

0 comments on commit 97e5fbd

Please sign in to comment.