fail-fast object destructuring
brendan at mozilla.org
Fri Jul 6 10:37:38 PDT 2012
Andreas Rossberg wrote:
> We should talk more at this month's TC39 meeting, but I see a
> sharp divide ahead:
> 1. Choose (A), possibly with modification, either rejecting useful
> pattern matching decisively, or else making its pattern language
> differ by making prefix-! implicit. But you rejected splitting
> pattern meaning across destructuring and future pattern-matching,
> in the last sentence cited above.
> 2. Choose (B) because future-proofing for pattern matching wants
> prefix-?, and impose a compatibility break from what we and others
> implemented, and what most JS users might expect based on JS's
> carefree imputing of undefined.
> Comments from es-discuss peanut gallery welcome.
> I could go for 1/A, except for two facts. First, I believe there
> is a non-trivial body of Firefox JS that depends on imputing
> undefined. Second, and what is more important: we haven't
> usability-tested 2/B at all.
> Did you mean "could go for 2/B" there?
I rearranged and renumbered but missed this one. Clearly I meant 2/B.
I'm a bit unhappy about making such a change so long after implementing
1/A (without prefix-!). But never mind me -- what do others think?
More information about the es-discuss