An array destructing specification choice

Andreas Rossberg rossberg at google.com
Mon Nov 7 02:18:16 PST 2011


On 5 November 2011 17:44, Brendan Eich <brendan at mozilla.com> wrote:
> Destructuring is "irrefutable" in that it desugars to assignments from properties of the RHS. It is not typed; it is not refutable

I don't think that's true, at least not in the usual sense of
"irrefutable pattern". Because you can write

  let {x} = 666

which will be refuted, by raising a TypeError.

Of course, the real question is, what does this do:

  let {} = 666

/Andreas


More information about the es-discuss mailing list