On Sep 29, 2011, at 11:07 AM, Sean Eagan wrote:

> Sorry to drag on about array holes, but:
> 
> Should holes in spread elements (e.g. [...holeyArray]) and arguments
> (e.g. f(...holeyArray)) reflect as holes in the array they are spliced
> into to avoid information loss ?  The current proposal [1] reflects
> them as `undefined` values.

You need to read the draft ES6 spec.  It specifies that spread used in array 
literals preserves holes.  I haven't written the spec. for spread in argument 
lists but clearly interior holes need to be passed as undefined.  Trailing 
holes in a spread in the final argument position could be trimmed but that 
would mean that:

    foo.apply(undefined, new Array(5))
and
   foo(...(new Array(5))

wouldn't pass the same thing which seems like it would be an issue.


Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to