From f4a6fb79da8eef224ca21046e0cb22d8d44fa012 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 3 Jan 2019 13:29:43 -0800 Subject: [PATCH] Replace ternary expression --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 54f878ebef0..de44e8bb37c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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 {