mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
a43fc2bcf3f4e854796c99e2e9414609ad1a36c7
Earlier PRs in the stack change the way we lower OptionalMemberExpression, but only when they ultimately appear inside some OptionalCallExpression. This PR ensures that _all_ OptionalMemberExpressions get the new lowering. Note that one test case has what is arguably a regression, but the new behavior is also reasonable: if we see both `a.b?.c` and `a.b.c.` as dependencies of a scope, we previously inferred `a.b.c` as the dependency, but we now infer `a.b` as the dependency. This isn't as optimal as what we had before, but it also seems good enough for now. Also note that some cases are improved: `foo(a.b?.c)` would previously have taken `a.b` as a dependency, we now take the full value of `a.b?.c` as a dependency - more precise. So overall i'm inclined to land and follow-up on the one regression, since the overall model is more cohesive.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%