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
This allows callers like `canUseNativeAppleFlow` to use plain
conditionals instead of try/catch, and use more `const` so that
the type-checker is better able to see when a variable can no longer
be a value like `undefined`.
In this case, for example, if instead of this change a `return false`
is simply added to the `catch` block, then Flow still believes the
`host !== undefined` check below is necessary (and that without it
the `host.endsWith(…)` call is ill-typed), because `host` is a
mutable binding and Flow doesn't see how to prove that it doesn't get
set back to `undefined`. With `const` everywhere, the logic to rule
out such possibilities is more straightforward and the type-checker
is able to see it.
0 commit comments