ES3.1 Draft: Array generics

Brendan Eich brendan at mozilla.org
Tue May 20 09:19:21 PDT 2008


On May 20, 2008, at 8:02 AM, Erik Arvidsson wrote:

> On Tue, May 20, 2008 at 07:35, Douglas Crockford  
> <douglas at crockford.com> wrote:
>> I disagree. Gmail can continue patching Array.prototype as it does  
>> now, so
>> nothing breaks. But going forward, new applications should be  
>> using bind instead
>> of a thisoObject.
>
> Yes, Google can and will change it's usage if IE does it this way.  It
> is a price I am willing to pay but this makes proposed ES3.1
> incompatible with ES3+Reality.  Something that will break the web.

What's more, bind is not free -- it may require an extra object.

There is no necessary reason, given bind and map, to insist that map  
not take an optional third argument obviating the need for bind in  
conjunction with map. Factoring to the Nth degree is not mandated.  
Minimalism is good, but it does not trump all usability and  
efficiency considerations.

Anyway, existing implementations support the third parameter. If  
ES3.1 has as a principle codifying existing practice, it ought to do  
so here.

/be




More information about the Es4-discuss mailing list