From 3062d36463cf4777932274e5633755fe8aaee536 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 13 Jun 2017 15:20:52 -0700 Subject: [PATCH] Add "undefined" as return type --- src/compiler/utilities.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 3833fc30875..fde03cc7db2 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2721,11 +2721,11 @@ namespace ts { * Gets the effective type annotation of a variable, parameter, or property. If the node was * parsed in a JavaScript file, gets the type annotation from JSDoc. */ - export function getEffectiveTypeAnnotationNode(node: VariableLikeDeclaration): TypeNode { + export function getEffectiveTypeAnnotationNode(node: VariableLikeDeclaration): TypeNode | undefined { if (node.type) { return node.type; } - if (node.flags & NodeFlags.JavaScriptFile) { + if (isInJavaScriptFile(node)) { return getJSDocType(node); } } @@ -2734,11 +2734,11 @@ namespace ts { * Gets the effective return type annotation of a signature. If the node was parsed in a * JavaScript file, gets the return type annotation from JSDoc. */ - export function getEffectiveReturnTypeNode(node: SignatureDeclaration): TypeNode { + export function getEffectiveReturnTypeNode(node: SignatureDeclaration): TypeNode | undefined { if (node.type) { return node.type; } - if (node.flags & NodeFlags.JavaScriptFile) { + if (isInJavaScriptFile(node)) { return getJSDocReturnType(node); } }