Array.prototype.values() compatibility hazard

Brendan Eich brendan at mozilla.com
Tue Jun 18 18:50:35 PDT 2013


I blame 'with'. So, ex-Borland people at Netscape. And so, ultimately, 
myself.

/be

Allen Wirfs-Brock wrote:
> On Jun 18, 2013, at 3:05 PM, Brandon Benvie wrote:
>
>> On 6/18/2013 3:02 PM, Andrea Giammarchi wrote:
>>> can you try to hot-fix that via `with(values.values=values)` ?
>> That probably works, but it matters little since the hazard is with the existing installed base of sites that use this which would need to be updated. I can't imagine standardizing "whenever an identifier 'values' is found as the subject of a WithStatement, do ...." would fly either.
>
> and this hazard exists for any method name we add to an existing built-in prototype object.  "values" and "keys" and "entries" may be more likely to run into the problem as they are all plausible variable names but any new property name might break some with-users code in this same manner.
>
> Allen
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list