Draft of Function.prototype.bind.

Brendan Eich brendan at mozilla.com
Mon Nov 3 22:39:54 PST 2008


On Nov 3, 2008, at 10:26 PM, Maciej Stachowiak wrote:

> JavaScriptCore's RegExp objects have been callable since Safari 1.0  
> Beta 1 and I believe they have returned "function" from typeof that  
> whole time. (The Mozilla bug report says otherwise but I think that  
> testing must have been in error.)

Another report from 2005 testifies to the same result (typeof /hi/ ==  
"object" in Safari):

https://bugzilla.mozilla.org/show_bug.cgi?id=289933#c5

Could also be in error, but is it possible that back then the result  
was different?


> I'm not aware of any compatibility issues due to either the callable  
> extension

Agreed, the only "compatibility" issue with callable regexps is that  
some people read ECMA-262, the typeof sub-spec, and ask us to make  
typeof /hi/ == "function", while others compare that to IE (and  
Netscape 4, FWIW) and ask for "object".


> or the way typeof is reported as a result.

The typeof /hi/ == "function" result is considered broken by people  
developing against other browsers, trying to separate function objects  
from other kinds of objects, not caring about callable non-function  
objects.

/be


More information about the Es-discuss mailing list