Skip to content

Commit 3062d36

Browse files
author
Kanchalai Tanglertsampan
committed
Add "undefined" as return type
1 parent d392f1e commit 3062d36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/utilities.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,11 +2721,11 @@ namespace ts {
27212721
* Gets the effective type annotation of a variable, parameter, or property. If the node was
27222722
* parsed in a JavaScript file, gets the type annotation from JSDoc.
27232723
*/
2724-
export function getEffectiveTypeAnnotationNode(node: VariableLikeDeclaration): TypeNode {
2724+
export function getEffectiveTypeAnnotationNode(node: VariableLikeDeclaration): TypeNode | undefined {
27252725
if (node.type) {
27262726
return node.type;
27272727
}
2728-
if (node.flags & NodeFlags.JavaScriptFile) {
2728+
if (isInJavaScriptFile(node)) {
27292729
return getJSDocType(node);
27302730
}
27312731
}
@@ -2734,11 +2734,11 @@ namespace ts {
27342734
* Gets the effective return type annotation of a signature. If the node was parsed in a
27352735
* JavaScript file, gets the return type annotation from JSDoc.
27362736
*/
2737-
export function getEffectiveReturnTypeNode(node: SignatureDeclaration): TypeNode {
2737+
export function getEffectiveReturnTypeNode(node: SignatureDeclaration): TypeNode | undefined {
27382738
if (node.type) {
27392739
return node.type;
27402740
}
2741-
if (node.flags & NodeFlags.JavaScriptFile) {
2741+
if (isInJavaScriptFile(node)) {
27422742
return getJSDocReturnType(node);
27432743
}
27442744
}

0 commit comments

Comments
 (0)