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

Multiple assignments to the same unused array don't get removed #1442

Open
nicolo-ribaudo opened this issue Sep 7, 2023 · 0 comments
Open

Comments

@nicolo-ribaudo
Copy link

nicolo-ribaudo commented Sep 7, 2023

Bug report or Feature request?

Feature request

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

Whatever is on try.terser.org as of 2023-09-07

Complete CLI command or minify() options used

{
  "module": false
}

terser input

function g() {
  var e = [];
  e[1] = 1;
}

function f() {
  var e = [];
  e[0] = 0;
  e[1] = 1;
}

terser output or error

function g(){}function f(){var n=[];n[0]=0,n[1]=1}

Expected result

Given that terser is able to remove e in g, I would expect it to also be able to remove e in f:

function g(){}function f(){}
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

1 participant