On 7 November 2011 17:07, Allen Wirfs-Brock <[email protected]> wrote: >> let {x} = 666 >> >> which will be refuted, by raising a TypeError. > > No, > > It does ToObject(666) and then looks for the "x" property of the resulting > wrapper object.
Ouch, really? I don't see that in the proposal (http://wiki.ecmascript.org/doku.php?id=harmony:destructuring), and to be honest, it sounds like a horrible idea. It is just another way to silently inject an `undefined' that is tedious to track down. We already have too many of those... When would this ever be useful behaviour instead of just obfuscating bugs? /Andreas _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

