mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Fix property assignment on aliases (#24659)
Aliases don't have valueDeclarations, which caused a crash when passed to isJavascriptContainer before.
This commit is contained in:
committed by
GitHub
parent
f9530d7e8f
commit
7db4b1cbc7
@@ -2510,11 +2510,12 @@ namespace ts {
|
||||
* - with non-empty object literals if assigned to the prototype property
|
||||
*/
|
||||
function isJavascriptContainer(symbol: Symbol): boolean {
|
||||
const node = symbol.valueDeclaration;
|
||||
if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.NamespaceModule)) {
|
||||
return true;
|
||||
}
|
||||
const init = isVariableDeclaration(node) ? node.initializer :
|
||||
const node = symbol.valueDeclaration;
|
||||
const init = !node ? undefined :
|
||||
isVariableDeclaration(node) ? node.initializer :
|
||||
isBinaryExpression(node) ? node.right :
|
||||
isPropertyAccessExpression(node) && isBinaryExpression(node.parent) ? node.parent.right :
|
||||
undefined;
|
||||
|
||||
Reference in New Issue
Block a user