lebab / lebab

Turn your ES5 code into readable ES6. Lebab does the opposite of what Babel does.

Home Page:https://lebab.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate variable declarations with destructuring are partially converted to let/const

nene opened this issue · comments

For example, the below code should not be converted to let/const:

   var a = 1;
   var {a, b} = createObj();

Lebab understand that a is a repeated variable, but ignores the fact that b is declared together with it and attempts to convert it to const:

   var a = 1;
   const {a, b} = createObj();