@@ -2977,23 +2977,22 @@ namespace ts {
29772977 // util.property = function ...
29782978 bindExportsPropertyAssignment ( node as BindableStaticPropertyAssignmentExpression ) ;
29792979 }
2980+ else if ( hasDynamicName ( node ) ) {
2981+ bindAnonymousDeclaration ( node , SymbolFlags . Property | SymbolFlags . Assignment , InternalSymbolName . Computed ) ;
2982+ const sym = bindPotentiallyMissingNamespaces ( parentSymbol , node . left . expression , isTopLevelNamespaceAssignment ( node . left ) , /*isPrototype*/ false , /*containerIsClass*/ false ) ;
2983+ addLateBoundAssignmentDeclarationToSymbol ( node , sym ) ;
2984+ }
29802985 else {
2981- if ( hasDynamicName ( node ) ) {
2982- bindAnonymousDeclaration ( node , SymbolFlags . Property | SymbolFlags . Assignment , InternalSymbolName . Computed ) ;
2983- const sym = bindPotentiallyMissingNamespaces ( parentSymbol , node . left . expression , isTopLevelNamespaceAssignment ( node . left ) , /*isPrototype*/ false , /*containerIsClass*/ false ) ;
2984- addLateBoundAssignmentDeclarationToSymbol ( node , sym ) ;
2985- }
2986- else {
2987- bindStaticPropertyAssignment ( cast ( node . left , isBindableStaticAccessExpression ) ) ;
2988- }
2986+ bindStaticPropertyAssignment ( cast ( node . left , isBindableStaticNameExpression ) ) ;
29892987 }
29902988 }
29912989
29922990 /**
29932991 * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function (or IIFE) or class or {}, or not declared.
29942992 * Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y;
29952993 */
2996- function bindStaticPropertyAssignment ( node : BindableStaticAccessExpression ) {
2994+ function bindStaticPropertyAssignment ( node : BindableStaticNameExpression ) {
2995+ Debug . assert ( ! isIdentifier ( node ) ) ;
29972996 node . expression . parent = node ;
29982997 bindPropertyAssignment ( node . expression , node , /*isPrototypeProperty*/ false , /*containerIsClass*/ false ) ;
29992998 }
0 commit comments