-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Compress output for optional chain with multiple ?.
#15740
Compress output for optional chain with multiple ?.
#15740
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/54764/ |
6324cbb
to
117cab1
Compare
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.
The output is much better, thank you!
117cab1
to
f4bf0ba
Compare
@SimenB Multiple PRs are failing with this (flaky) failure, but I fail to see how it can be Babel-related. However, it only fails for our "breaking" tests and not for the Babel 7 tests. |
Hmmm, no. The test uses I can update the test to use 2 times it fails to delete a file since it's not there, and once it fails to launch node since the file isn't there. Seems a bit odd... 😅 |
Thank you! I can test that PR in our CI to see if it makes the problem go away. Is it possible that those failure are just hiding a real error? They started happening in #15736 🤔 |
That'd be great 👍
That's what I was thinking |
Fixes #1, Fixes #2
delete a?.b
in function params #15739.a?.b?.c
froma == null ? void 0 : a.b == null ? void 0 : a.b.c
toa == null || a.b == null ? void 0 : a.b.c
, to only emitvoid 0
once.delete a?.b
froma == null ? true : delete a.b
toa == null || delete a.b
.a()?.b?.c
fromvar _tmp1, _tmp2; (_tmp1 == a()) == null || (_tmp2 = _tmp1.b) == null ? void 0 : _tmp2.c
tovar _tmp1; (_tmp1 == a()) == null || (_tmp1 = _tmp1.b) == null ? void 0 : _tmp1.c
.Terser doesn't do these optimization by itself, so this change also brings improvements to minified code.