Skip to content

Commit 5bb7079

Browse files
committed
Don't contextually type JS function declarations
1 parent 42b8f70 commit 5bb7079

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17212,8 +17212,7 @@ namespace ts {
1721217212
}
1721317213

1721417214
function isContextSensitiveFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean {
17215-
return (!isFunctionDeclaration(node) || isInJSFile(node) && !!getTypeForDeclarationFromJSDocComment(node)) &&
17216-
(hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node));
17215+
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
1721717216
}
1721817217

1721917218
function hasContextSensitiveReturnExpression(node: FunctionLikeDeclaration) {
@@ -17222,7 +17221,7 @@ namespace ts {
1722217221
}
1722317222

1722417223
function isContextSensitiveFunctionOrObjectLiteralMethod(func: Node): func is FunctionExpression | ArrowFunction | MethodDeclaration {
17225-
return (isInJSFile(func) && isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) &&
17224+
return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) &&
1722617225
isContextSensitiveFunctionLikeDeclaration(func);
1722717226
}
1722817227

0 commit comments

Comments
 (0)