fail-fast object destructuring (don't add more slop to sloppy mode)

Brendan Eich brendan at mozilla.com
Wed Jan 2 19:58:33 PST 2013


I think we can do this now. Allen should weigh in. Hope to hear from 
Andreas R. soon too!

Apologies for the long thread, and thanks to Herby for interaction that 
clarified many things. Perhaps I should resummarize:

The best new-new plan to avoid adding slop is to revise ES6 
destructuring thus:

1. No ToObject(RHS).
2. Exception on missing property selected without a ?-suffix.
3. ?-suffix allowed on any pattern, imputing undefined deeply instead of 
refuting.
4: the ? is a separate lexeme from the : in long-hand patterns.

How's that?

/be

Kevin Smith wrote:
>
>
>     The proposed behavior when a non-leaf is marked irrefutable (the
>     entire subtree is essentially irrefutable) 
>
>
> Sorry, should read:
>
> The proposed behavior when a non-leaf is marked irrefutable (the 
> entire subtree imputes undefined when triggered) ...
>
>


More information about the es-discuss mailing list