 
     ast))
 
-(defmethod ana/parse '.
-  [_ env [_ target field & member+ :as form] _ opts]
-  (ana/disallowing-recur (shadow-analyze-dot env target field member+ form opts)))
 
 ;; its private in cljs.compiler ...
 (def es5>=

        (when-not (= :statement (:context env))
          (comp/emit-wrap env
            (comp/emits (comp/munge info))))))))

(defmethod comp/emit* :var [expr] (shadow-emit-var expr))
(defmethod comp/emit* :binding [expr] (shadow-emit-var expr))
(defmethod comp/emit* :js-var [expr] (shadow-emit-var expr))
(defmethod comp/emit* :local [expr] (shadow-emit-var expr))

;; noop
(defn shadow-load-core [])

          (vary-meta assoc :tag 'boolean)))
    `(some? ~x)))


;; private is just annoying, get rid of that
;; we need access to these below

(alter-meta! #'cljs.core/to-property dissoc :private)
(alter-meta! #'cljs.core/ifn-invoke-methods dissoc :private)
(alter-meta! #'cljs.core/adapt-obj-params dissoc :private)


;; multimethod in core, although I don't see how this is ever going to go past 2 impls?
;; also added the metadata for easier externs inference
;; switched .. to nested . since .. looses form meta

(defn shadow-extend-prefix [tsym sym]
  (let [prop-sym (core/to-property sym)]
    (case (-> tsym meta :extend)
      :instance
      `(. ~tsym ~prop-sym)
      ;; :default
      `(. (. ~tsym ~'-prototype) ~prop-sym))))

(defn shadow-add-obj-methods [type type-sym sigs]
  (map (fn [[f & meths :as form]]
         (let [[f meths] (if (vector? (first meths))
                                [f [(rest form)]]
                                [f meths])]
           `(set! ~(with-meta
                     (shadow-extend-prefix type-sym f)
                     {:shadow/object-fn f})
              ~(with-meta `(fn ~@(map #(core/adapt-obj-params type %) meths)) (meta form)))))
    sigs))

;; CLJS-3003
(defn shadow-add-ifn-methods [type type-sym [f & meths :as form]]
  (let [this-sym (with-meta 'self__ {:tag type})
        argsym (gensym "args")

        ;; we are emulating JS .call where the first argument will become this inside the fn
        ;; but this is not actually what we want when emulating IFn since we need "this"
        ;; so the first arg is always dropped instead and we dispatch to the actual protocol fns
        call-fn
        `(fn [unused#]
           (core/this-as ~this-sym
             (case (-> (core/js-arguments) (core/alength) (core/dec))
               ~@(reduce
                   (fn [form [args & body]]
                     (let [arity (-> args (count) (dec))]
                       (conj
                         form
                         arity
                         (concat
                           (list
                             (symbol (str ".cljs$core$IFn$_invoke$arity$" arity))
                             this-sym)
                           (for [ar (range arity)]
                             `(core/aget (core/js-arguments) ~(inc ar)))))))
                   []
                   meths)
               (throw (js/Error. (str "Invalid arity: " (-> (core/js-arguments) (core/alength) (core/dec)))))
               )))]

    (concat
      [`(set! ~(shadow-extend-prefix type-sym 'call) ~(with-meta call-fn (meta form)))
       `(set! ~(shadow-extend-prefix type-sym 'apply)
          ~(with-meta
             `(fn ~[this-sym argsym]
                (core/this-as ~this-sym
                  (.apply (.-call ~this-sym) ~this-sym
                    (.concat (core/array ~this-sym) (core/aclone ~argsym)))))
             (meta form)))]
      (core/ifn-invoke-methods type type-sym form))))

(defn install-hacks! []
  ;; cljs.analyzer tweaks
  (replace-fn! #'ana/load-core shadow-load-core)
