Re: How to clean up __proto__ (was: Why we need to clean up __proto__)

2011-12-30 Thread David Bruant
Le 30/12/2011 02:28, John J Barton a écrit : On Thu, Dec 29, 2011 at 5:11 PM, David Bruant bruan...@gmail.com mailto:bruan...@gmail.com wrote: Le 30/12/2011 01:00, Lasse Reichstein a écrit : On Thu, Dec 29, 2011 at 8:41 PM, Mark S. Miller erig...@google.com

Array.prototype.contains

2011-12-30 Thread Xavier MONTILLET
Hi, http://wiki.ecmascript.org/doku.php?id=harmony:string_extras There is a proposal for String.prototype.contains so why can't I find one for Array.prototype.contains? Regards. ___ es-discuss mailing list es-discuss@mozilla.org

Sorted arrays

2011-12-30 Thread Xavier MONTILLET
Hi, I think it would be useful to have sort store somewhere in the array how it was sorted if it was and a new method append that would insert an item so that the array is still sorted. Here's how it could be implemented in ES 5 (you would use Object.defineProperty to make methods non

Re: Sorted arrays

2011-12-30 Thread Axel Rauschmayer
That sounds like you’d want a different data structure: a sorted set. Or a sorted multi-set. I’d rather write a new constructor than extend Array. You’d also be able to search for elements faster (binary search). On Dec 30, 2011, at 15:46 , Xavier MONTILLET wrote: Hi, I think it would be

Re: How to clean up __proto__ (was: Why we need to clean up __proto__)

2011-12-30 Thread Russell Leggett
On Fri, Dec 30, 2011 at 6:53 AM, David Bruant bruan...@gmail.com wrote: Le 30/12/2011 02:28, John J Barton a écrit : On Thu, Dec 29, 2011 at 5:11 PM, David Bruant bruan...@gmail.com wrote: Le 30/12/2011 01:00, Lasse Reichstein a écrit : On Thu, Dec 29, 2011 at 8:41 PM, Mark S. Miller

Re: How to clean up __proto__ (was: Why we need to clean up __proto__)

2011-12-30 Thread gaz Heyes
On 30 December 2011 17:05, John J Barton johnjbar...@johnjbarton.comwrote: On Fri, Dec 30, 2011 at 3:53 AM, David Bruant bruan...@gmail.com wrote: How did this competition begin? A use case for JS security environment is loading app components cross-site. The other site is 'trusted' in

Re: Why we need to clean up __proto__

2011-12-30 Thread Brendan Eich
I don't think __proto__-supporting implementations will do anyone any favors by banning the special meaning of __proto__ in ES5 strict mode. The likeliest outcomeis further non-adoption of ES5 strict mode by developers, who already avoid it because of deoptimization effects. In particular,

Re: Array.prototype.contains

2011-12-30 Thread Jason Orendorff
On Fri, Dec 30, 2011 at 6:58 AM, Xavier MONTILLET xavierm02@gmail.com wrote: http://wiki.ecmascript.org/doku.php?id=harmony:string_extras There is a proposal for String.prototype.contains so why can't I find one for Array.prototype.contains? No kidding. I need this method every time I

Re: Array.prototype.contains

2011-12-30 Thread Rick Waldron
On Fri, Dec 30, 2011 at 5:24 PM, Jason Orendorff jason.orendo...@gmail.comwrote: On Fri, Dec 30, 2011 at 6:58 AM, Xavier MONTILLET xavierm02@gmail.com wrote: http://wiki.ecmascript.org/doku.php?id=harmony:string_extras There is a proposal for String.prototype.contains so why can't I

Re: Array.prototype.contains

2011-12-30 Thread Brendan Eich
Jason doesn't want a wrapper written in JS that depends on the current value of this.indexOf, I think. That's enough reason for a built-in. This is a no-brainer for ES6 IMHO. /be - Original Message - From: Rick Waldron waldron.r...@gmail.com To: Jason Orendorff

Re: Array.prototype.contains

2011-12-30 Thread Rick Waldron
That's what I figured - I guess I thinking of implementations that would be ES3 5 compat Thanks! On Fri, Dec 30, 2011 at 6:26 PM, Brendan Eich bren...@mozilla.com wrote: Jason doesn't want a wrapper written in JS that depends on the current value of this.indexOf, I think. That's enough

Re: How to clean up __proto__ (was: Why we need to clean up __proto__)

2011-12-30 Thread David Bruant
Le 30/12/2011 17:07, Russell Leggett a écrit : On Fri, Dec 30, 2011 at 6:53 AM, David Bruant bruan...@gmail.com mailto:bruan...@gmail.com wrote: Le 30/12/2011 02:28, John J Barton a écrit : On Thu, Dec 29, 2011 at 5:11 PM, David Bruant bruan...@gmail.com

Re: How to clean up __proto__ (was: Why we need to clean up __proto__)

2011-12-30 Thread David Bruant
Le 30/12/2011 18:05, John J Barton a écrit : On Fri, Dec 30, 2011 at 3:53 AM, David Bruant bruan...@gmail.com mailto:bruan...@gmail.com wrote: Le 30/12/2011 02:28, John J Barton a écrit : On Thu, Dec 29, 2011 at 5:11 PM, David Bruant bruan...@gmail.com mailto:bruan...@gmail.com