Array.prototype.values() compatibility hazard

Claude Pache claude.pache at gmail.com
Wed Jun 19 00:36:51 PDT 2013


I've just added a warning on the corresponding page of the MDN JavaScript Reference [1] (the last bullet of the Description section and the red box at the top of the page), so that this Reference ceases to be guilty of not warning that `with` is future-hostile.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with

—Claude

Le 19 juin 2013 à 07:06, Andrea Giammarchi <andrea.giammarchi at gmail.com> a écrit :

> you should, but only partially! I mean, Ext.js still relying into `with(whatever)` behavior is as guilty as any decision made in last 5 years ... no matter the subject ...
> 
> 
> On Tue, Jun 18, 2013 at 6:50 PM, Brendan Eich <brendan at mozilla.com> wrote:
> 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
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130619/99b170e6/attachment.html>


More information about the es-discuss mailing list