Allow |, &, and ^ operators to have null/undefined inputs#22232
Allow |, &, and ^ operators to have null/undefined inputs#22232
|, &, and ^ operators to have null/undefined inputs#22232Conversation
sandersn
left a comment
There was a problem hiding this comment.
The change looks good and I think the usages this enables are fine too. I'd like another reviewer to sign off before merging, just so we get two people thinking about unintended consequences.
|
I like this change, ofc. @rbuckton you're a real fan of the undefined-is-implicitly-bitwise-zero pattern; you agree with this? |
|
TIL I'm hesitant on this because (a) you could just use |
|
Ofc, the reason we want it is because we use the fact that null/undefined are effectively zero in bitwise ops extensively inside our codebase. Tbqh, I think the question to ask, is how often does forcing you to handle null/undefined explicitly here find an error, versus just forcing you to write (and slowly become blind to) nonnull assertions. |
|
Note: |
|
Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it. |
Fixes #22230
Would make #22088 simpler