What follows is just some exploration; it isn’t necessary to understand and (unfortunately) doesn’t provide a solution. I used Chrome for this exploration.
When apply is called with a JavaScript function, you generally end up at this branch:
So our example code ends up as:
The js method .apply expects its first argument to be the this value for the function call. So our code passes the actual function as this, when we really want the object. Why is apply written this way and not considered broken?
apply does work in some cases. Static methods work, likely because they don’t rely on this:
If we could somehow get the instance from the method call (e.g. get console from console.log), we could fix cljs apply to work in more (all?) cases. But we can’t do that in js, so I guess we’re kinda sunk. ¯\_(ツ)_/¯