Subj : Re: Array and [ ] To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Sat Jan 22 2005 06:25 pm Igor Bukanov wrote: > So the question is was this ability to change [] semantics via Array > modification intentional? They implement it in their own way of 15.4. And this is what users might expect. Users might be surprised, if the literal construction is also affected by replacing the Array function from 15.4 by a user defined function. When I did experiments with user defined Array funtions and literals some years ago, I got suprised that I destroyed the original implementation also for the literals not just for the new Aray(1,2,3). I worried about, whether this implementation of JavaScript is a bug. The spec is unclear. It does not say, that "the expression new Array()" means a hardcoding of 15.4. But it also does not say that "the expression new Array()" means any user defined variant of this expresion. So it is unclear, whether the JavaScript implementation is, what was intended by the spec or the hard coding of 15.4. JScript does not implement the Array object ECMA conform at all, because no where is specifed that length is read only, but JScript implements it as read only. So JScript is that kind of bird feed, we call bug. ;-) -- Georg Maaß - bioshop.de D-76227 Karlsruhe, Westmarkstraße 82 HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net - The ultimate DHTML engine: http://gml-modul.sourceforge.net - http://sourceforge.net/projects/gml-modul .