You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve match transform logic for determining if an 'in' check is needed for an object property's pattern
Summary:
Original Author: [email protected]
Original Git: a62edf1
Original Reviewed By: alexmckenley
Original Revision: D67777384
The most basic example is:
```
const e = match (x) {
{foo: undefined}: 0,
}
```
Previously we only outputted a check that `x.foo === undefined`, but if `foo` doesn't exist, this would still pass (e.g. input `{}`). To fix this, add an `in` check in that scenario. Also properly handle As and Or Patterns. Note that since an Identifier or Member Pattern may resolve to `undefined`, we add the `in` check for all those cases.
Reviewed By: fbmal7
Differential Revision: D67946144
fbshipit-source-id: aedc7ab25c13231dd83b87ed729245f4f9959c48
0 commit comments