Fixes #605 (closed)
Formerly:
[1 2 3]; // [1, 2, 3];
let [a b c] = []; // let [a, b, c] = [];
({ a: 1 b: 2 c: 3 }); // ({a: 1, b:2, c: 3});
let { a b c } = {}; // let { a, b, c } = {};
let [...rest, a] = []; // let [...rest_0] = [];
[...[],]; // [...[],,];
All of these cases save the last should throw (it was simply parsing incorrectly). Now they do:
[1 2 3]
// Error: unexpected token
// __2__ 3
let [a b c] = [];
// Error: unexpected token
// __b__ c
({ a: 1 b: 2 c: 3 })
// Error: unexpected token
// __b__ : 2 c : 3
let { a b c } = {};
// Error: unexpected token
// __b__ c
let [...rest, a] = [];
// Error: Rest element must be last element in array
// , a
[...[],]; // [...[]];