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
Treating a Promise as a boolean in an if block is currently allowed. Given that it'll always be trueish, I don't think the pattern has any legitimate use.
Turning it into an error would be really useful in code using async validation / assertion functions, e.g.:
// always true
if (checkOwnership(subject, account)) {
// should be
if (await checkOwnership(subject, account)) {
The text was updated successfully, but these errors were encountered:
Treating a Promise as a boolean in an
if
block is currently allowed. Given that it'll always be trueish, I don't think the pattern has any legitimate use.Turning it into an error would be really useful in code using async validation / assertion functions, e.g.:
The text was updated successfully, but these errors were encountered: