termi / es6-transpiler

Tomorrow's JavaScript syntax today
Other
216 stars 18 forks source link

Destructuring breaks if no space between 'var' and pattern #75

Open webbedspace opened 9 years ago

webbedspace commented 9 years ago

The code function e(){ var[a,b]=[1,2];return a} wrongly compiles to

function e(){ vara = (b = [1,2])[0], b = b[1];return a}

which, as you can see, mangles the var keyword.