Re: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Waldemar Horwat
Allen Wirfs-Brock wrote: -Original Message- From: Brendan Eich [mailto:bren...@mozilla.com] Sorry, I meant the issue James raised: the property is bound and then RangeError is thrown. Seems like error-checking should happen before any effects are committed. In general, it's probably n

RE: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Allen Wirfs-Brock
>-Original Message- >From: Brendan Eich [mailto:bren...@mozilla.com] > >Sorry, I meant the issue James raised: the property is bound and then >RangeError is thrown. Seems like error-checking should happen before >any effects are committed. > In general, it's probably not possible to pre-ch

Re: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Brendan Eich
On May 13, 2009, at 11:44 AM, Allen Wirfs-Brock wrote: From: Brendan Eich It's totally an edge case, but if everyone agrees, it will probably get spec'ed at some point. For ES5, probably not -- up to Allen at this point. It's already spec'ed to throw in both ES3 and ES5. It's in Array ins

RE: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Allen Wirfs-Brock
>From: Brendan Eich > >It's totally an edge case, but if everyone agrees, it will probably >get spec'ed at some point. For ES5, probably not -- up to Allen at >this point. > It's already spec'ed to throw in both ES3 and ES5. It's in Array instance's [[DefineOwnProperty]] in ES5 and [[Put]] for E

Re: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Brendan Eich
On May 13, 2009, at 8:33 AM, Jason Orendorff wrote: On Wed, May 13, 2009 at 10:19 AM, Allen Wirfs-Brock wrote: Firefox 3.0.8 - does not conform No range error on a.push(1) returns 0, creates a non-array index property named "4294967295" and sets length to 0 It's possible that developmental

Re: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Jason Orendorff
On Wed, May 13, 2009 at 10:19 AM, Allen Wirfs-Brock wrote: > Firefox 3.0.8 - does not conform > No range error on a.push(1) returns 0, creates a non-array index property > named "4294967295" and sets length to 0 > > It's possible that developmental builds of the above produce different > results

RE: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Allen Wirfs-Brock
Obviously I meant "push" rather than "pop" in the second to last paragraph >-Original Message- >From: es-discuss-boun...@mozilla.org [mailto:es-discuss- >boun...@mozilla.org] On Behalf Of Allen Wirfs-Brock >Sent: Wednesday, May 13, 2009 8:19 AM >To: James Graham; es-discuss@mozilla.org; es

RE: Array lengthening methods applied to maximally long arrays

2009-05-13 Thread Allen Wirfs-Brock
Here's what I observed: Opera 9.63 - conforms to ES3/ES5 spec. Range error on a.push(1) after creating a non-array index property named "4294967295" and leaving length as 4294967295 Chrome 1.0.154.65 conforms to ES3/ES5 spec. Range error on a.push(1) after creating a non-array index property nam

Array lengthening methods applied to maximally long arrays

2009-05-13 Thread James Graham
As far as I can tell, the ES5-specified behavior of a = new Array() a.length = Math.pow(2,32)-1 a.push(1) is to create a non-array-index property of the array with name 4294967296 (i.e. 2^32) and value 1 before throwing a RangeError hen trying to update the length. However this property isn't