Replace ternary expression

This commit is contained in:
Sheetal Nandi 2019-01-03 13:29:43 -08:00
parent d8ee4116ef
commit f4a6fb79da

View File

@ -11040,7 +11040,7 @@ namespace ts {
function hasContextSensitiveReturnExpression(node: FunctionLikeDeclaration) {
// TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.
return !node.body || node.body.kind === SyntaxKind.Block ? false : isContextSensitive(node.body);
return !!node.body && node.body.kind !== SyntaxKind.Block && isContextSensitive(node.body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration {