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

enhance inline #3767

Merged
merged 1 commit into from
Apr 10, 2020
Merged

enhance inline #3767

merged 1 commit into from
Apr 10, 2020

Conversation

alexlamsl
Copy link
Collaborator

No description provided.

@alexlamsl alexlamsl merged commit b35f4c5 into mishoo:master Apr 10, 2020
@alexlamsl alexlamsl deleted the inline-direct branch April 10, 2020 02:49
@kzc
Copy link
Contributor

kzc commented Apr 10, 2020

Here's a related feature you might consider implementing:

$ echo 'var x; x=Math.random(); console.log(x,x);' | bin/uglifyjs -c toplevel,passes=9
var x;x=Math.random(),console.log(x,x);

This is a common pattern appearing after a function is inlined.

It can be optimized to:

var x=Math.random(),console.log(x,x);

@kzc
Copy link
Contributor

kzc commented Apr 10, 2020

Correction - should be:

var x=Math.random();console.log(x,x);

There's a chance it could pessimise sequence optimizations, so it would have to be applied only in certain situations.

@alexlamsl alexlamsl mentioned this pull request Apr 16, 2020
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

Successfully merging this pull request may close these issues.

2 participants