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

Brendan Eich brendan at mozilla.com
Wed Jan 2 12:47:11 PST 2013


Brendan Eich wrote:
> Brendan Eich wrote:
>> To tolerate o = null and o = undefined (which is not what o.p?.q 
>> does), the equivalence would be:
>
> I forgot to avoid the other slop, implicit ToObject conversion. 
> Correcting:
>
> "To tolerate primitive type value in o (which is not what o.p?.q 
> does), the equivalence would be:"

Er, strike that -- not what CoffeeScript does, not wanted.

But this raises an issue: should ? applied to the whole object (o?.p in 
expression, {p:q}? = o in pattern language) also cause an implicit 
ToObject(o)?

/be


More information about the es-discuss mailing list