with-meta doesn't work for variable arguments functions

Description

Currently with-meta doesn't work for varargs fns (which works in Clojure):

Given JS is so flexible I'd propose the following implementation of meta fn:

The goog/bind creates a copy, and the goog/mixin is just for performance reasons (copy any IFn protocol or applyTo).

Benefits:

  • Slightly faster

  • Much simpler and smaller code (the 20 arities of MetaFn are emitted 3 times (.call, .apply, prototype.IFn)

  • Works with varargs.

Environment

None

Assignee

Unassigned

Reporter

Andre R

Labels

None

Approval

None

Patch

None

Affects versions

Priority

Minor
Configure