On Feb 19, 2015, at 9:01 AM, Andrea Giammarchi wrote:

> I think I do understand ... is this operation valid in ES6 ?
> 
> `var oneTwoThree = Array.prototype.concat(1, 2, 3); // [1, 2, 3]`
> 
> 'cause that was the initial concern, and as far as I understand that will 
> break.
> 
> Or does it?

Yes, it will break if Array.prototype is an ordinary object because of the 
special treatment that Array.prototype.concat gives to arrays.  Also, 
JSON.stringify.

An alternative fix would be to make IsArray(Array.prototype) answer true, but 
that seems like even a big hack.  It's also hard to specify in a manner that 
works cross-realms.

Allen





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

Reply via email to