Currently, IWithMeta is implemented for functions by wrapping the function in a MetaFn type.
However, this breaks certain expectations about the typeof of the meta-fied value:
The primary case when this is not ideal is when interoping with JS code that does checks using typeof, like React does:
Ideally, with-meta would preserve the typeof value when possible.
N/A
There's a separate issue about MetaFn's and varargs, https://dev.clojure.org/jira/browse/CLJS-2446, whose proposed implementation also solves this particular edge case.
Attached patch:
replaces `MetaFn` type with `meta-fn` helper that creates new fn
with IMeta specify!'d on it.
Also fixes CLJS-2446: with-meta doesn't work for variable arguments functions
Adds tests for metadata and fns