Refutable destructuring

Dmitry Soshnikov dmitry.soshnikov at gmail.com
Wed Aug 14 09:54:30 PDT 2013


On Tuesday, August 13, 2013, Allen Wirfs-Brock wrote:

>
> On Aug 13, 2013, at 2:31 PM, Brendan Eich wrote:
>
> > Andreas Rossberg wrote:
> >> As I said in my reply, I'm totally fine with what you describe in that
> >> mail. But correct me if I'm wrong, that_is_  refutable destructuring,
> >> isn't it? All you seem to drop is the optional irrefutable part (the
> >> '?' feature). That's why I am quite confused about Brendan's statement
> >> above.
> >
> > Possibly I missed something (I was at the meeting on the 2nd and 3rd
> days but not day 1).
> >
> > Allen, what does your latest draft do on
> >
> >  var {p} = {};
> >
> > Throw, or bind p to undefined?
>
> throws
>
> to bind to undefined you would say:
>
> var {p=undefined} = {};
>
>
OK, so it's turned out to be refutable nevertheless. It seems everyone was
missing this point until this mail on the thread.

>From the implementation perspective it's postponed to runtime check with
stopping the destrucuring, and just throwing at first mismatch.

Thanks for the I info. It's also probably worth waiting until Sep meeting
for possible changes.

Dmitry



> Allen
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org <javascript:;>
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130814/df260866/attachment-0001.html>


More information about the es-discuss mailing list