Having a non-enumerable Array.prototype.contains may not be web-compatible

Boris Zbarsky bzbarsky at mit.edu
Tue Sep 30 12:18:03 PDT 2014

On 9/30/14, 2:45 PM, Michał Wadas wrote:
> Bug in MooTools is not a reason to make any method of Array.prototype
> enumerable.

I didn't say we need to make it enumerable.

I said that given the current state of the web, a web browser cannot 
ship a non-enumerable method named "contains" on Array.prototype.

The options, therefore, are:

1)  Make the method enumerable.
2)  Name the method something else.
3)  Don't ship the method until every site that currently uses the
     buggy versions of MooTools (which is every site that uses
     MooTools, since they only fixed it 4 days ago).

I'm perfectly fine with option 3, personally.  Note that in practice 
that likely means "never ship it" unless people make some sort of 
concerted effort to get sites to update their MooTools version.


P.S. It may be worth avoiding the method names mootools sets up but 
doesn't force-copy in the future.  Even better would be getting them to 
fix their code so there are no such method names, of course.

More information about the es-discuss mailing list