Permalink
Browse files

* src/clj/cljs/compiler.clj: remove pointless emission of "void 0;"

  • Loading branch information...
1 parent e3c6991 commit ac9d82c21b6082b85c3676bbb08da117987c67d6 David Nolen committed Jul 4, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/clj/cljs/compiler.clj
@@ -189,8 +189,7 @@
~@body
(when-not (= :expr (:context env#)) (emitln ";"))))
-(defmethod emit :no-op
- [m] (emits "void 0;"))
+(defmethod emit :no-op [m])
(defmethod emit :var
[{:keys [info env] :as arg}]
@@ -322,15 +321,14 @@
(defmethod emit :def
[{:keys [name init env doc export]}]
- (if init
+ (when init
(let [mname (munge name)]
(emit-comment doc (:jsdoc init))
(emits mname)
(emits " = " init)
(when-not (= :expr (:context env)) (emitln ";"))
(when export
- (emitln "goog.exportSymbol('" (munge export) "', " mname ");")))
- (emitln "void 0;")))
+ (emitln "goog.exportSymbol('" (munge export) "', " mname ");")))))
(defn emit-apply-to
[{:keys [name params env]}]

0 comments on commit ac9d82c

Please sign in to comment.