                 (emitln "return " n ".call(this" (if (zero? pcnt) nil
                                                      (list "," (comma-sep (take pcnt maxparams)))) ");"))))
           (emitln "}")
-          (emitln "panic(new js.Error('Invalid arity: ' + arguments.length));")
+          (emitln "panic(js.Error{'Invalid arity: ' + arguments.length});")
           (emitln "};")
           (when variadic
             (emitln mname ".cljs$lang$maxFixedArity = " max-fixed-arity ";")

      (emit-constant (if ns
                       (str ns "/" name)
                       name))
      (emits ");\n"))))

(defn emit-constants-table-to-file [table dest]
  (with-open [out ^java.io.Writer (io/make-writer dest {})]

      (emits "cljs.core.PersistentVector.EMPTY")
      (let [cnt (count items)]
        (if (< cnt 32)
          (emits "cljs.core.PersistentVector{null, " cnt
            ", 5, cljs.core.PersistentVector.EMPTY_NODE, ["  (comma-sep items) "], null}")
          (emits "cljs.core.PersistentVector.fromArray([" (comma-sep items) "], true)"))))))

(defn distinct-constants? [items]
