Cherry-pick PR #35198 into release-3.7 (#35240)

Component commits:
9c0fab93b2 Fix crash with Object.defineProperty for imported alias (--allowJs)
Fixes #35196
This commit is contained in:
TypeScript Bot
2019-11-20 13:20:25 -08:00
committed by Nathan Shively-Sanders
parent c18d72f220
commit b9d52319ef
5 changed files with 42 additions and 4 deletions
+1 -1
View File
@@ -2792,7 +2792,7 @@ namespace ts {
function bindObjectDefinePrototypeProperty(node: BindableObjectDefinePropertyCall) {
const namespaceSymbol = lookupSymbolForPropertyAccess((node.arguments[0] as PropertyAccessExpression).expression as EntityNameExpression);
if (namespaceSymbol) {
if (namespaceSymbol && namespaceSymbol.valueDeclaration) {
// Ensure the namespace symbol becomes class-like
addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, SymbolFlags.Class);
}