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

Clean up inline assignments #32

Open
Kyuuhachi opened this issue Sep 1, 2022 · 0 comments
Open

Clean up inline assignments #32

Kyuuhachi opened this issue Sep 1, 2022 · 0 comments

Comments

@Kyuuhachi
Copy link

The following code

var r,i=(r=n(224736))&&r.__esModule?r:{default:r};

is unminified to

var r;
var i = (r = n(224736)) && r.__esModule ? r : {default: r};

It would be nice if it could be rewritten as

var r = n(224736);
var i = r && r.__esModule ? r : {default: r};

One would have to be careful that this doesn't affect evaluation order, but I've seen that pattern often enough that it would be nice to have it fixed. I've seen similar things with if statements, var bi; if((bi=foo())===null||bi===void 0){, too.

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