Subj : Re: Array and [ ] To : =?ISO-8859-1?Q?Georg_Maa=DF?= From : Brendan Eich Date : Sun Jan 23 2005 09:29 am Georg Maaß wrote: > Brendan Eich wrote: > >>> The production ArrayLiteral : [ Elision opt ] is evaluated as follows: >>> 1. Create a new array as if by the expression "new Array()" >> >> >> The spec is unambiguous here. Elsewhere, it talks about "the original >> value of the Object.prototype property", or similar such words. This >> should be fixedd at some point, but I haven't managed to get the ECMA >> TG1 group as a whole to go through the >> http://www.mozilla.org/js/language/E262-3-errata.html yet, let alone >> consider this question. > > > There is no entry about 11.1.4. I know -- I said "let alone" meaning that the current topic is beyond the known errata. We still haven't agreed on the right spec. >> Another way to fix things is to make Array readonly and permanent in >> the global object (likewise all standard class constructors and other >> predefined global properties). > > > If it is not specified as read only then making it read only means > implementing a bug. There is no need to make it impossible to users to > customize their Array constructor. I was not talking about implementing a bug, I was talking about another way to fix the spec. Personally I prefer the current SpiderMonkey way, and if you want to be able to change Array (as shown in your previous post, to lowercase string elements added to instances, e.g. -- although a subclass of Array might be more appropriate in a real application), more power to you. But if you want Array to be mutable, then I think you should want [] to be short-hand for new Array. /be .