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
collapsing switch cases with same bodies, when not lined in a row #1070
collapsing switch cases with same bodies, when not lined in a row #1070
Conversation
…llthrough_with_same_body)
Wondering if @jridgewell wants to give a final approval. It looks great to merge to me, especially those tests <3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd already approved. 😉
@fabiosantoscode @jridgewell great, what's next? |
@fabiosantoscode will be able to merge. For the next PR, we could work on getting |
Hey! This is indeed good to merge! Thanks @elad-yosifon 🚀 |
… row (terser#1070)" This reverts commit 8430c66.
@fabiosantoscode maybe a option to disable this would be better? because runtime order may be optimized, and will slow if do this |
@LongTengDao ATM this is buggy, so I think this should be disabled but not discarded. |
This is an additional optimization that leverages changes from #1044 @jridgewell
Current code does not fully optimize the following code:
The current output returns something like this:
The expected output in this case should be:
Adding a default case can benefit the optimization even more:
The expected output here should be: