Skip to content

Commit 29655a2

Browse files
committed
CLJS-867: extend-type with Object methods requires multi-arity style definition
Object protocol method support was missing reshaping logic
1 parent eeb86ae commit 29655a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/clj/cljs/core.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,11 @@
791791

792792
(defn add-obj-methods [type type-sym sigs]
793793
(map (fn [[f & meths :as form]]
794-
`(set! ~(extend-prefix type-sym f)
795-
~(with-meta `(fn ~@(map #(adapt-obj-params type %) meths)) (meta form))))
794+
(let [[f meths] (if (vector? (first meths))
795+
[f [(rest form)]]
796+
[f meths])]
797+
`(set! ~(extend-prefix type-sym f)
798+
~(with-meta `(fn ~@(map #(adapt-obj-params type %) meths)) (meta form)))))
796799
sigs))
797800

798801
(defn ifn-invoke-methods [type type-sym [f & meths :as form]]

0 commit comments

Comments
 (0)