Comment made by: kurtharriger
The above also suggests that maybe one could extend IEncodeClojure on nil?
a
is not nil
but its type is... so maybe extending protocol on nil should this work?
But it doesn't... maybe this is a bug in satisfies?
?
`
cljs.user=> (def a (.create js/Object nil))
'cljs.user/a
cljs.user=> (aset a "test" 1)
1
cljs.user=> (extend-protocol IEncodeClojure
nil
(-js->clj (link: x opts)
(let (link: {:keys [keywordize-keys)} opts
keyfn (if keywordize-keys keyword str)]
(into {} (for (link: k (js-keys x))
(link: (keyfn k) (js->clj (unchecked-get x k)) opts))))))
nil
cljs.user=> (js->clj a)
object(link: Object)
cljs.user=> (js-keys IEncodeClojure)
js (link: "null")
cljs.user=> (satisfies? IEncodeClojure a)
false
cljs.user=> (type a)
nil
`