@@ -168,7 +168,7 @@ module ts {
168168 addDeclarationToSymbol ( symbol , node , includes ) ;
169169 symbol . parent = parent ;
170170
171- if ( node . kind === SyntaxKind . ClassDeclaration && symbol . exports ) {
171+ if ( ( node . kind === SyntaxKind . ClassDeclaration || node . kind === SyntaxKind . ClassExpression ) && symbol . exports ) {
172172 // TypeScript 1.0 spec (April 2014): 8.4
173173 // Every class automatically contains a static property member named 'prototype',
174174 // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter.
@@ -286,6 +286,7 @@ module ts {
286286 case SyntaxKind . ArrowFunction :
287287 declareSymbol ( container . locals , undefined , node , symbolKind , symbolExcludes ) ;
288288 break ;
289+ case SyntaxKind . ClassExpression :
289290 case SyntaxKind . ClassDeclaration :
290291 if ( node . flags & NodeFlags . Static ) {
291292 declareSymbol ( container . symbol . exports , container . symbol , node , symbolKind , symbolExcludes ) ;
@@ -485,6 +486,9 @@ module ts {
485486 case SyntaxKind . ArrowFunction :
486487 bindAnonymousDeclaration ( < FunctionExpression > node , SymbolFlags . Function , "__function" , /*isBlockScopeContainer*/ true ) ;
487488 break ;
489+ case SyntaxKind . ClassExpression :
490+ bindAnonymousDeclaration ( < ClassExpression > node , SymbolFlags . Class , "__class" , /*isBlockScopeContainer*/ false ) ;
491+ break ;
488492 case SyntaxKind . CatchClause :
489493 bindCatchVariableDeclaration ( < CatchClause > node ) ;
490494 break ;
@@ -584,9 +588,9 @@ module ts {
584588 // containing class.
585589 if ( node . flags & NodeFlags . AccessibilityModifier &&
586590 node . parent . kind === SyntaxKind . Constructor &&
587- node . parent . parent . kind === SyntaxKind . ClassDeclaration ) {
591+ ( node . parent . parent . kind === SyntaxKind . ClassDeclaration || node . parent . parent . kind === SyntaxKind . ClassExpression ) ) {
588592
589- let classDeclaration = < ClassDeclaration > node . parent . parent ;
593+ let classDeclaration = < ClassLikeDeclaration > node . parent . parent ;
590594 declareSymbol ( classDeclaration . symbol . members , classDeclaration . symbol , node , SymbolFlags . Property , SymbolFlags . PropertyExcludes ) ;
591595 }
592596 }
0 commit comments