Draft of Function.prototype.bind.

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Tue Nov 4 10:52:11 PST 2008


Brendan Eich wrote:
> 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.

What's wrong with that release being the one that first supports ES3.1
(so that in ES3.1, native objects are callable iff they are functions)?

There will be other minor incompatibilities that are required by ES3.1,
so it seems as though that release will have to be one "whose numbering
allows [you] to break compatibility".

-- 
David-Sarah Hopwood



More information about the Es-discuss mailing list