codeparty/racer — pull request #11 by rads (2012-03-29 05:06:23+00:00)
Title: Check for Function type with instanceof rather than the call property to fix incompatibility with ClojureScript

While I was trying out Racer with ClojureScript, I was getting an error with the following code:

(.on model "set" "*"
(fn [id value]
(js/alert value)))

The error was

Uncaught Error: addListener only takes instances of Function

I figured out the problem was that ClojureScript's core library defines String.prototype.call, so when eventListener() checks the existence of the call method, it thinks a String is actually a Function and returns prematurely. I modified the code to avoid this problem by using instanceof to check the type instead.