Permalink
Browse files

fix JavaScriptCore related regression - the clever bit around defs w/o

init is causing tests to fail when running against JSC only under
advanced compilation.
  • Loading branch information...
1 parent ab6325d commit 0cc0d0f190ca2d89cbb3e09ef4e9115879a4611b @swannodette swannodette committed Mar 15, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/clj/cljs/compiler.clj
@@ -351,9 +351,12 @@
(let [mname (munge name)]
(emit-comment doc (:jsdoc init))
(emits mname)
- (if init
+ (when init
(emits " = " init)
- (emits " = (typeof " mname " != 'undefined') ? " mname " : undefined"))
+ ;; NOTE: JavaScriptCore does not like this under advanced compilation
+ ;; this change was primarily for REPL interactions - David
+ ;(emits " = (typeof " mname " != 'undefined') ? " mname " : undefined")
+ )
(when-not (= :expr (:context env)) (emitln ";"))
(when export
(emitln "goog.exportSymbol('" (munge export) "', " mname ");"))))

0 comments on commit 0cc0d0f

Please sign in to comment.