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

Duplicated variable initialization when unminifying #54

Closed
mobapedia opened this issue Jan 28, 2024 · 1 comment
Closed

Duplicated variable initialization when unminifying #54

mobapedia opened this issue Jan 28, 2024 · 1 comment
Labels
bug Something isn't working unminify

Comments

@mobapedia
Copy link

Any variables initialized inside a for loop inside an inline if statement will be duplicated when unminifying.

for example:

if (1) for (a=1,b=2,c=3;a<10;a++){}

will turn into:

if (1) {
  a = 1;
  b = 2;
  c = 3;
  a = 1;
  b = 2;
  c = 3;
  for (; a < 10; a++) {}
}
@j4k0xb
Copy link
Owner

j4k0xb commented Jan 29, 2024

Nice catch 👍🏻
Fixed in 2d889c6 (playground is already updated, npm release will follow soon)

@j4k0xb j4k0xb closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unminify
Projects
None yet
Development

No branches or pull requests

2 participants