@@ -1384,7 +1384,7 @@ namespace ts {
13841384 // Export assignment in some sort of block construct
13851385 bindAnonymousDeclaration ( node , SymbolFlags . Alias , getDeclarationName ( node ) ) ;
13861386 }
1387- else if ( boundExpression . kind === SyntaxKind . Identifier ) {
1387+ else if ( boundExpression . kind === SyntaxKind . Identifier && node . kind === SyntaxKind . ExportAssignment ) {
13881388 // An export default clause with an identifier exports all meanings of that identifier
13891389 declareSymbol ( container . symbol . exports , container . symbol , node , SymbolFlags . Alias , SymbolFlags . PropertyExcludes | SymbolFlags . AliasExcludes ) ;
13901390 }
@@ -1445,8 +1445,16 @@ namespace ts {
14451445
14461446 // Look up the function in the local scope, since prototype assignments should
14471447 // follow the function declaration
1448- const classId = < Identifier > ( < PropertyAccessExpression > ( < PropertyAccessExpression > node . left ) . expression ) . expression ;
1449- const funcSymbol = container . locals [ classId . text ] ;
1448+ const leftSideOfAssignment = node . left as PropertyAccessExpression ;
1449+ const classPrototype = leftSideOfAssignment . expression as PropertyAccessExpression ;
1450+ const constructorFunction = classPrototype . expression as Identifier ;
1451+
1452+ // Fix up parent pointers since we're going to use these nodes before we bind into them
1453+ leftSideOfAssignment . parent = node ;
1454+ constructorFunction . parent = classPrototype ;
1455+ classPrototype . parent = leftSideOfAssignment ;
1456+
1457+ const funcSymbol = container . locals [ constructorFunction . text ] ;
14501458 if ( ! funcSymbol || ! ( funcSymbol . flags & SymbolFlags . Function ) ) {
14511459 return ;
14521460 }
@@ -1457,7 +1465,7 @@ namespace ts {
14571465 }
14581466
14591467 // Declare the method/property
1460- declareSymbol ( funcSymbol . members , funcSymbol , < PropertyAccessExpression > node . left , SymbolFlags . Property , SymbolFlags . PropertyExcludes ) ;
1468+ declareSymbol ( funcSymbol . members , funcSymbol , leftSideOfAssignment , SymbolFlags . Property , SymbolFlags . PropertyExcludes ) ;
14611469 }
14621470
14631471 function bindCallExpression ( node : CallExpression ) {
0 commit comments