bitovi/canjs — pull request #787 by ccummings (2014-03-14 02:26:39+00:00)
Title: Changing typeof check to a check for apply (#681)

One of the methods that goes through this code path is a RegExp and in certain older browsers, RegExp is callable meaning using `typeof` on one returns`'function'`. So it passes the `typeof` check and when we try to use `apply` on the RegExp it throws an error.

You can see bugs to fix this weirdness in [all](https://bugs.webkit.org/show_bug.cgi?id=28285) [major](https://code.google.com/p/v8/issues/detail?id=617) [browsers](https://bugzilla.mozilla.org/show_bug.cgi?id=582717#c7).

The fix is to check `method` for `apply` instead of using a `typeof` check.

Closes #681