deftype*

special formsince v0.0-927Edit
Parser code @ clojurescript:src/main/clojure/cljs/analyzer.cljc
(defmethod parse 'deftype*
  [_ env form _ _]
  (parse-type :deftype env form))

Emitting code @ clojurescript:src/main/clojure/cljs/compiler.cljc
(defmethod emit* :deftype
  [{:keys [t fields pmasks body protocols]}]
  (let [fields (map munge fields)]
    (emitln "")
    (emitln "/**")
    (emitln "* @constructor")
    (doseq [protocol protocols]
      (emitln " * @implements {" (munge (str protocol)) "}"))
    (emitln "*/")
    (emitln (munge t) " = (function (" (comma-sep fields) "){")
    (doseq [fld fields]
      (emitln "this." fld " = " fld ";"))
    (doseq [[pno pmask] pmasks]
      (emitln "this.cljs$lang$protocol_mask$partition" pno "$ = " pmask ";"))
    (emitln "});")
    (emit body)))