Draft of Function.prototype.bind.

Brendan Eich brendan at mozilla.com
Mon Nov 3 22:11:43 PST 2008


On Nov 3, 2008, at 8:14 PM, David-Sarah Hopwood wrote:

> The resolution of that bug is clearly nonformant to ES3 section  
> 11.4.3,
> as at least two commenters ('Ish' and Garrett Smith) pointed out.

Yes, that's obvious! No prize for noticing. We intentionally violated  
ECMA-262 there, for the reasons I gave in reply to Mark's message: Web  
+ Mozilla platform compatibility. Web compatibility wants typeof /hi/  
== "object". Mozilla compatibility back to 1997 or so wants /hi/ 
("...hi.") to call exec and return ["hi"].

We'll make regexps non-callable in a future release whose numbering  
allows us to break compatibility for all the users who may be relying  
on this JS extension.

/be


More information about the Es-discuss mailing list