-
-
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
Fix destructuring evaluation with call expressions #4552
Conversation
Do not optimize destructions with callExpressions, as the call might change the value of a variable that we are assigning to. Fixes #4054
Current coverage is 88.35% (diff: 100%)@@ master #4552 diff @@
==========================================
Files 194 194
Lines 13624 13626 +2
Methods 1427 1427
Messages 0 0
Branches 3151 3153 +2
==========================================
+ Hits 12037 12039 +2
Misses 1587 1587
Partials 0 0
|
Please see my comments in original issue here: #4054 (comment) |
members expressions might be getters who have side effects
Can I ask, does As I mentioned in 2nd part of my comment #4054 (comment), I think in some (fairly niche) circumstances this can be unsafe to optimize too. I don't know what babel's policy is on balancing optimization versus rock solid reliability. Perhaps the edge cases I'm pointing out are really pretty unlikely to ever occur in the real world, but hey, I value reliability over pretty much anything else. |
@overlookmotel I think we would tend to lean on the reliability side. smaller/faster output can go under a |
lgtm can always make another pr for others |
* Fix destructuring evaluation with call expressions Do not optimize destructions with callExpressions, as the call might change the value of a variable that we are assigning to. Fixes babel#4054 * Also deopt on member expressions members expressions might be getters who have side effects
Do not optimize destructions with callExpressions or memberExpressions, as the call
might change the value of a variable that we are assigning to and memberExpressions might be getters with side effects.