@@ -4714,10 +4714,6 @@ namespace ts {
47144714 // function/class/{} assignments are fresh declarations, not property assignments, so only add prototype assignments
47154715 const specialDeclaration = getAssignedJavascriptInitializer(symbol.valueDeclaration);
47164716 if (specialDeclaration) {
4717- const tag = getJSDocTypeTag(specialDeclaration);
4718- if (tag && tag.typeExpression) {
4719- return getTypeFromTypeNode(tag.typeExpression);
4720- }
47214717 return getWidenedLiteralType(checkExpressionCached(specialDeclaration));
47224718 }
47234719 const types: Type[] = [];
@@ -5085,7 +5081,7 @@ namespace ts {
50855081 }
50865082
50875083 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)) {
50895085 const exports = createSymbolTable();
50905086 while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
50915087 const s = getSymbolOfNode(decl);
@@ -15790,22 +15786,22 @@ namespace ts {
1579015786 }
1579115787
1579215788 // 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.
1579415790 function isContextSensitiveAssignment(binaryExpression: BinaryExpression): boolean {
1579515791 const kind = getSpecialPropertyAssignmentKind(binaryExpression);
1579615792 switch (kind) {
1579715793 case SpecialPropertyAssignmentKind.None:
1579815794 return true;
1579915795 case SpecialPropertyAssignmentKind.Property:
15800- case SpecialPropertyAssignmentKind.ExportsProperty:
15801- case SpecialPropertyAssignmentKind.Prototype:
15802- case SpecialPropertyAssignmentKind.PrototypeProperty:
1580315796 // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration.
1580415797 // 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 :
1580715800 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;
1580915805 default:
1581015806 return Debug.assertNever(kind);
1581115807 }
0 commit comments