Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect destructuring assignment when minifying to ES6 #524

Closed
ykagan opened this issue May 9, 2017 · 1 comment
Closed

Incorrect destructuring assignment when minifying to ES6 #524

ykagan opened this issue May 9, 2017 · 1 comment

Comments

@ykagan
Copy link

ykagan commented May 9, 2017

When using destructuring assignment on arrays with mangle-names enabled.

const me = () => {
 let [a,b,c,d] = [1,2,3,4];
 [a,b,c,d] = [5,6,7,8];
 console.log(a,b,c,d);
}

The second assignment produces this incorrect code:

const me=()=>{let[e,f,g,h]=[1,2,3,4];[e,h,g,h]=[5,6,7,8],console.log(e,f,g,h)};

Note that transforming to ES5 or turning off mangle names produces correct code.

@ykagan ykagan changed the title Incorrect array destructoring assigning when minifying to ES6 Incorrect destructuring assignment when minifying to ES6 May 9, 2017
@boopathi
Copy link
Member

boopathi commented May 9, 2017

Thanks. #390 fixed this and this doesn't happen in current master. I'll release a new version after a few more fixes get in.

@boopathi boopathi closed this as completed May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants