Draft of Function.prototype.bind.

Maciej Stachowiak mjs at apple.com
Mon Nov 3 22:55:28 PST 2008


On Nov 3, 2008, at 10:39 PM, Brendan Eich wrote:

> 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 checked out the code from 2002, and it looks like it would return  
"function", but thanks to the Apple DevTools team's love of  
incompatible build file format changes, I can't easily build to verify.

>
>> 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.

I'm sure people may have an opinion one way or the other, I just don't  
know of any Web content actually broken by this in practice. I don't  
have strong feelings on the matter in either direction, just reporting  
our experience.

Regards,
Maciej




More information about the Es-discuss mailing list