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

For/of mangling produces duplicated const names #921

Closed
TrySound opened this issue Jan 23, 2021 · 2 comments
Closed

For/of mangling produces duplicated const names #921

TrySound opened this issue Jan 23, 2021 · 2 comments
Labels

Comments

@TrySound
Copy link
Contributor

Bug report or Feature request?

Bug

Version (complete output of terser -V or specific git commit)

terser 5.5.1

Complete CLI command or minify() options used

terser --module --mangle -o output.js input.js

terser input

export function Stave() {
    const beams = [];
    for (const [key, notes] of []) {
        const isUp = true;
        beams.push(isUp);
    }
}

terser output or error

// prettified output
export function Stave() {
  const o = [];
  for (const [t, n] of []) {
    const t = true;
    o.push(t);
  }
}

Expected result

Without conflicting consts

@TrySound TrySound changed the title For/of mangling produces duplicated For/of mangling produces duplicated const names Jan 23, 2021
@fabiosantoscode
Copy link
Collaborator

Hey there @TrySound :)

Thanks for this report!

@fabiosantoscode
Copy link
Collaborator

Closing as the conversation on the other ticket didn't really find a bug. (for future reference, a duplicate t is fine in this case because the scope of const [t is not the same as the loop body's scope)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants