@@ -2977,23 +2977,22 @@ namespace ts {
2977
2977
// util.property = function ...
2978
2978
bindExportsPropertyAssignment ( node as BindableStaticPropertyAssignmentExpression ) ;
2979
2979
}
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
+ }
2980
2985
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 ) ) ;
2989
2987
}
2990
2988
}
2991
2989
2992
2990
/**
2993
2991
* 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.
2994
2992
* Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y;
2995
2993
*/
2996
- function bindStaticPropertyAssignment ( node : BindableStaticAccessExpression ) {
2994
+ function bindStaticPropertyAssignment ( node : BindableStaticNameExpression ) {
2995
+ Debug . assert ( ! isIdentifier ( node ) ) ;
2997
2996
node . expression . parent = node ;
2998
2997
bindPropertyAssignment ( node . expression , node , /*isPrototypeProperty*/ false , /*containerIsClass*/ false ) ;
2999
2998
}
0 commit comments