                 ~type ~(with-meta `(fn ~@meths) (meta form))))
         sigs))))
 
+(defn prototype-prefix [tsym sym]
+  `(.. ~tsym -prototype ~(to-property sym)))
+
 (defmacro extend-type [tsym & impls]
   (let [env       &env
         resolve   (partial resolve-var env)

                                                    (let [[tname & args] sig]
                                                      (list (vec args) (list* 'this-as (vary-meta tname assoc :tag t) body))))]
                                 (map (fn [[f & meths :as form]]
                                        `(set! ~(prototype-prefix f)
                                               ~(with-meta `(fn ~@(map adapt-params meths)) (meta form))))
                                      sigs))
                               (concat (when-not (skip-flag psym)
                                         [`(set! ~(prototype-prefix pprefix) true)])
                                       (mapcat (fn [[f & meths :as form]]
                                                 (if (= psym 'cljs.core/IFn)
                                                   (let [adapt-params (fn [[[targ & args :as sig] & body]]

    (if-let [type (base-type tsym)]
      `(do ~@(mapcat #(base-assign-impls env resolve tsym type %) impl-map))
      (let [t (resolve tsym)
            assign-impls (fn [[p sigs]]
                           (warn-and-update-protocol p t &env)
                           (let [psym (resolve p)
