destructuring: as patterns?

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Apr 18 15:45:19 PDT 2012


On Apr 18, 2012, at 2:48 PM, Brendan Eich wrote:

> David Herman wrote:
>> *Please*, let's do this right.
> This says to me (what I originally expected) that duplicate property name at any ply in an object pattern should be an early error.
> 
> Anyone disagree?


I'm not sure that the concern about repeated side-effects is very significant given that any property access can have arbitrary side-effects including adding and removing properties from the RHS object. 

Regardless, making duplicate property names an early error is easy enough and seems to eliminate a potential point of confusion.

I'm not necessarily sold on "as" yet. 

Allen










More information about the es-discuss mailing list