gajus/flow-runtime

Do you want to work on this issue?
You can request for a bounty in order to promote it!
Add assertions when implicitly returning from a function #2
phpnode posted onGitHub
Currently if a function implicitly returns undefined (by leaving the function without an explicit return
statement) we won't generate a check for it, e.g:
function foo (): string {
// no return
}
currently compiles to:
function foo () {
const _returnType = t.return(t.string());
// no return
}
We should insert a call to _returnType.assert(undefined)
at these points.