[compiler] Prune all unused array destructure items during DCE (#31619)
We didn't originally support holes within array patterns, so DCE was only able to prune unused items from the end of an array pattern. Now that we support holes we can replace any unused item with a hole, and then just prune the items to the last identifier/spread entry. Note: this was motivated by finding useState where either the state or setState go unused — both are strong indications that you're violating the rules in some way. By DCE-ing the unused portions of the useState destructuring we can easily check if you're ignoring either value. closes #31603 This is a redo of that PR not using ghstack
J
Joseph Savona committed
eee5ca2a92c32103b6bc3c1f7e6cdf1c4807ee56
Parent: aba370f
Committed by GitHub <noreply@github.com>
on 11/22/2024, 8:59:59 PM