Merge pull request #9397 from Microsoft/fix-crash-in-async-and-no-implicit-returns-targeting-es5

Fix crash in async functions when targetting ES5.
This commit is contained in:
Nathan Shively-Sanders
2016-06-29 18:31:11 -07:00
committed by GitHub
4 changed files with 51 additions and 1 deletions

View File

@@ -15388,7 +15388,7 @@ namespace ts {
function isUnwrappedReturnTypeVoidOrAny(func: FunctionLikeDeclaration, returnType: Type): boolean {
const unwrappedReturnType = isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType;
return maybeTypeOfKind(unwrappedReturnType, TypeFlags.Void | TypeFlags.Any);
return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, TypeFlags.Void | TypeFlags.Any);
}
function checkReturnStatement(node: ReturnStatement) {