fix not-native tag for optimized cljs prot invocation

This commit is contained in:
Nathan Marz 2015-07-03 17:40:13 -04:00
parent 66f992efa7
commit 1d93961cd3

View file

@ -1,10 +1,11 @@
(ns com.rpl.specter.prot-opt-invoke) (ns com.rpl.specter.prot-opt-invoke)
(defmacro mk-optimized-invocation [protocol obj method num-args] (defmacro mk-optimized-invocation [protocol obj method num-args]
(let [args (take num-args (repeatedly gensym))] (let [args (take num-args (repeatedly gensym))
o (-> (gensym) (with-meta {:tag 'not-native}))]
`(if (~'implements? ~protocol ~obj) `(if (~'implements? ~protocol ~obj)
(fn [^not-native o# ~@args] (fn [~o ~@args]
(~method o# ~@args) (~method ~o ~@args)
) )
~method ~method
))) )))