sweet-js/sweet-core

Fix destructuring bindings

gabejohnson opened this issue · 0 comments

#650 fixed issues w/ destructuring assignments in declarations. However, these forms

[...a, ] = b;
[, x, ...y,] = 0;
// and
[...{a=0},]=0;

should all throw with Uncaught SyntaxError: Rest element must be last element.
The issue is w/ transformDestructuring which tries to take a SpreadElement and transform it into a RestElement.

I'd like to take the tack suggested in #650 (comment)