rse / es6-features

ECMAScript 6: Feature Overview & Comparison
https://rse.github.io/es6-features/
Other
6.22k stars 1.13k forks source link

Destructuring Assignment/Array Matching sample does not work as expected on the 'reduced' version #87

Open ericvera opened 7 years ago

ericvera commented 7 years ago

In the case of:

var list = [ 1, 2, 3 ]
var [ a, , b ] = list
[ b, a ] = [ a, b ]

list[ b, a ] is interpreted as an array expression. http://astexplorer.net/ was useful to troubleshoot it.

rse commented 7 years ago

Hmmmm... correct, yes. But I cannot do anything here as the reduced version is automatically generated from the semicolon-based source.