cjohansen/Sinon.JS — pull request #83 by viadeo (2012-02-10 11:13:17+00:00)
Title: Fixing Internet Explorer stubbing of functions that originate in a different window 

I'm using Sinon in conjunction with Jasmine-ui (https://github.com/tigbro/jasmine-ui), which opens the application under test in a popup and passes a reference to the window to the test runner.

Internet Explorer has an odd bug where, for functions originating in an external window, ``typeof fnc`` will report ``object`` instead of ``function`` and thus ``wrapMethod`` throws a TypeError.

I've added instead ``isFunction`` that checks for the presence of constructor, apply and call (it could be spoofed by an object, of course, but since we're typically in control of what we want to stub I don't suppose it's much of an issue)