Hi all,
In playing with destructuring, it seems like there are some syntax gotchas
that really should trigger some sort of error and instead fail silently.
For instance:
```
let {} = foo;
```
This line does absolutely nothing and is most likely an error on the
developer's part. However, this is completely valid syntax and not a
parsing error. Fortunately, it's pretty clear from looking at it that
there's a problem. Another example isn't so clear:
```
let { bar: {} } = foo;
```
This one, I'd argue, is even worse. It looks like it should do something,
but silently does nothing.
Is there any possibility to add an early error for empty destructuring
patterns (array and object)? It seems like this would save developers a lot
of trouble in the long run.
--
________________________________________
Nicholas C. Zakas
http://www.nczonline.net
@slicknet
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss