@@ -4714,10 +4714,6 @@ namespace ts {
4714
4714
// function/class/{} assignments are fresh declarations, not property assignments, so only add prototype assignments
4715
4715
const specialDeclaration = getAssignedJavascriptInitializer(symbol.valueDeclaration);
4716
4716
if (specialDeclaration) {
4717
- const tag = getJSDocTypeTag(specialDeclaration);
4718
- if (tag && tag.typeExpression) {
4719
- return getTypeFromTypeNode(tag.typeExpression);
4720
- }
4721
4717
return getWidenedLiteralType(checkExpressionCached(specialDeclaration));
4722
4718
}
4723
4719
const types: Type[] = [];
@@ -5085,7 +5081,7 @@ namespace ts {
5085
5081
}
5086
5082
5087
5083
function getJSInitializerType(decl: Node, symbol: Symbol, init: Expression | undefined): Type | undefined {
5088
- if (init && isInJavaScriptFile(init) && isObjectLiteralExpression(init) && init.properties.length === 0 ) {
5084
+ if (init && isInJavaScriptFile(init) && isObjectLiteralExpression(init)) {
5089
5085
const exports = createSymbolTable();
5090
5086
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
5091
5087
const s = getSymbolOfNode(decl);
@@ -15790,22 +15786,22 @@ namespace ts {
15790
15786
}
15791
15787
15792
15788
// In an assignment expression, the right operand is contextually typed by the type of the left operand.
15793
- // Don't do this for special property assignments unless there is a type tag on the assignment, to avoid circularity from checking the right operand .
15789
+ // Don't do this for special property assignments to avoid circularity.
15794
15790
function isContextSensitiveAssignment(binaryExpression: BinaryExpression): boolean {
15795
15791
const kind = getSpecialPropertyAssignmentKind(binaryExpression);
15796
15792
switch (kind) {
15797
15793
case SpecialPropertyAssignmentKind.None:
15798
15794
return true;
15799
15795
case SpecialPropertyAssignmentKind.Property:
15800
- case SpecialPropertyAssignmentKind.ExportsProperty:
15801
- case SpecialPropertyAssignmentKind.Prototype:
15802
- case SpecialPropertyAssignmentKind.PrototypeProperty:
15803
15796
// If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration.
15804
15797
// See `bindStaticPropertyAssignment` in `binder.ts`.
15805
- return !binaryExpression.left.symbol || binaryExpression.left.symbol.valueDeclaration && !!getJSDocTypeTag(binaryExpression.left.symbol.valueDeclaration) ;
15806
- case SpecialPropertyAssignmentKind.ThisProperty :
15798
+ return !binaryExpression.left.symbol;
15799
+ case SpecialPropertyAssignmentKind.ExportsProperty :
15807
15800
case SpecialPropertyAssignmentKind.ModuleExports:
15808
- return !binaryExpression.symbol || binaryExpression.symbol.valueDeclaration && !!getJSDocTypeTag(binaryExpression.symbol.valueDeclaration);
15801
+ case SpecialPropertyAssignmentKind.PrototypeProperty:
15802
+ case SpecialPropertyAssignmentKind.ThisProperty:
15803
+ case SpecialPropertyAssignmentKind.Prototype:
15804
+ return false;
15809
15805
default:
15810
15806
return Debug.assertNever(kind);
15811
15807
}
0 commit comments