       (when loop-locals
         (when (= :return (:context env))
             (emits "return "))
-        (emitln "((function (" (comma-sep (map munge loop-locals)) "){")
+        (emitln "((func (" (comma-sep (map munge loop-locals)) "){")
         (when-not (= :return (:context env))
             (emits "return ")))
       (if (= 1 (count methods))

(defmethod emit* :case*
  [{:keys [v tests thens default env]}]
  (when (= (:context env) :expr)
    (emitln "(function(){"))
  (let [gs (gensym "caseval__")]
    (when (= :expr (:context env))
      (emitln "var " gs ";"))
    (emitln "switch (" v ") {")
    (doseq [[ts then] (partition 2 (interleave tests thens))]
      (doseq [test ts]
        (emitln "case " test ":"))
      (if (= :expr (:context env))
        (emitln gs "=" then)
        (emitln then))
      (emitln "break;"))
    (when default
      (emitln "default:")
      (if (= :expr (:context env))

    (emitln "/**")
    (emitln "* @constructor")
    (emitln "*/")
    (emitln (munge t) " = (func (" (comma-sep fields) "){")
    (emitln "var this = new(" t ")")
    (doseq [fld fields]
      (emitln "this." fld " = " fld))
    (doseq [[pno pmask] pmasks]
      (emitln "this.cljs$lang$protocol_mask$partition" pno "$ = " pmask))
    (emitln "})")))

(defmethod emit* :defrecord*
