function returnsSynchronous ( ) { return false ; } async function returnsPromise ( ) { return false ; } async function asyncDoesHitElse ( ) { if ( returnsSynchronous ( ) ) { return true ; } else { return false ; } } function synchronousIsntAffected ( ) { if ( returnsSynchronous ( ) ) { console . log ( true ) ; } else { console . log ( false ) ; } const ternary = returnsSynchronous ( ) ? 'always' : 'never' ; while ( returnsSynchronous ( ) ) { break ; } const a = returnsSynchronous ( ) || 'other thing' ; } async function properlyAwaitedGivesNoBuildErrorsDirectCall ( ) { if ( await returnsPromise ( ) ) { console . log ( true ) ; } else { console . log ( false ) ; } const ternary = await returnsPromise ( ) ? 'always' : 'never' ; while ( await returnsPromise ( ) ) { break ; } const binaryExpressionBarBar = await returnsPromise ( ) || 'other thing' ; const binaryExpressionAndAnd = await returnsPromise ( ) && 'other thing' ; } async function properlyAwaitedGivesNoBuildErrorsPropertyAccess ( ) { const prom = returnsPromise ( ) ; if ( await prom ) { console . log ( true ) ; } else { console . log ( false ) ; } const ternary = await prom ? 'always' : 'never' ; while ( await prom ) { break ; } const binaryExpressionBarBar = await prom || 'other thing' ; const binaryExpressionAndAnd = await prom && 'other thing' ; } const savedPromise = returnsPromise ( ) ; function takesPromise ( prom ) { } function s ( ) { let p = returnsPromise ( ) ; takesPromise ( p = returnsPromise ( ) ) ; } function takesPromiseMaybe ( prom ) { if ( prom ) { } } const boo = { sendPromise : async ( ) => { return true ; } } ;