Array construction underspecified
Mark S. Miller
erights at google.com
Thu Jan 15 15:57:41 PST 2009
I see that the spec for constructing an array from an array literal has been
clarified to ensure that, even if Array.prototype is an accessor
property, that it's setter is not invoked to initialize the corresponding
element of the array. (This issue didn't arise in ES3 since it had no
However, the old unmodified text in 126.96.36.199 is
The length property of the newly constructed object is set to the number of
> The 0 property of the newly constructed object is set to item0 (if
> supplied); the 1 property of the
> newly constructed object is set to item1 (if supplied); and, in general,
> for as many arguments as there
> are, the k property of the newly constructed object is set to argument k,
> where the first argument is
> considered to be argument number 0.
This doesn't explain how these properties are set, but probably need to for
the same reason. As with array literals, I think this should directly define
data properties, ignoring potentially inherited accessors.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Es-discuss