codeparty/racer — pull request #10 by rads (2012-03-25 06:10:22+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.