@@ -112,6 +112,10 @@ module ts {
112
112
return "__new" ;
113
113
case SyntaxKind . IndexSignature :
114
114
return "__index" ;
115
+ case SyntaxKind . ExportAssignment :
116
+ return "default" ;
117
+ case SyntaxKind . ExportDeclaration :
118
+ return "__export" ;
115
119
}
116
120
}
117
121
@@ -137,9 +141,9 @@ module ts {
137
141
: Diagnostics . Duplicate_identifier_0 ;
138
142
139
143
forEach ( symbol . declarations , declaration => {
140
- file . bindDiagnostics . push ( createDiagnosticForNode ( declaration . name , message , getDisplayName ( declaration ) ) ) ;
144
+ file . bindDiagnostics . push ( createDiagnosticForNode ( declaration . name || declaration , message , getDisplayName ( declaration ) ) ) ;
141
145
} ) ;
142
- file . bindDiagnostics . push ( createDiagnosticForNode ( node . name , message , getDisplayName ( node ) ) ) ;
146
+ file . bindDiagnostics . push ( createDiagnosticForNode ( node . name || node , message , getDisplayName ( node ) ) ) ;
143
147
144
148
symbol = createSymbol ( 0 , name ) ;
145
149
}
@@ -310,13 +314,6 @@ module ts {
310
314
}
311
315
}
312
316
313
- function bindExportDeclaration ( node : ExportDeclaration ) {
314
- if ( ! node . exportClause ) {
315
- ( ( < ExportContainer > container ) . exportStars || ( ( < ExportContainer > container ) . exportStars = [ ] ) ) . push ( node ) ;
316
- }
317
- bindChildren ( node , 0 , /*isBlockScopeContainer*/ false ) ;
318
- }
319
-
320
317
function bindFunctionOrConstructorType ( node : SignatureDeclaration ) {
321
318
// For a given function symbol "<...>(...) => T" we want to generate a symbol identical
322
319
// to the one we would get for: { <...>(...): T }
@@ -478,9 +475,6 @@ module ts {
478
475
case SyntaxKind . ExportSpecifier :
479
476
bindDeclaration ( < Declaration > node , SymbolFlags . Import , SymbolFlags . ImportExcludes , /*isBlockScopeContainer*/ false ) ;
480
477
break ;
481
- case SyntaxKind . ExportDeclaration :
482
- bindExportDeclaration ( < ExportDeclaration > node ) ;
483
- break ;
484
478
case SyntaxKind . ImportClause :
485
479
if ( ( < ImportClause > node ) . name ) {
486
480
bindDeclaration ( < Declaration > node , SymbolFlags . Import , SymbolFlags . ImportExcludes , /*isBlockScopeContainer*/ false ) ;
@@ -489,6 +483,22 @@ module ts {
489
483
bindChildren ( node , 0 , /*isBlockScopeContainer*/ false ) ;
490
484
}
491
485
break ;
486
+ case SyntaxKind . ExportDeclaration :
487
+ if ( ! ( < ExportDeclaration > node ) . exportClause ) {
488
+ // All export * declarations are collected in an __export symbol
489
+ declareSymbol ( container . symbol . exports , container . symbol , < Declaration > node , SymbolFlags . ExportStar , 0 ) ;
490
+ }
491
+ bindChildren ( node , 0 , /*isBlockScopeContainer*/ false ) ;
492
+ break ;
493
+ case SyntaxKind . ExportAssignment :
494
+ if ( ( < ExportAssignment > node ) . expression . kind === SyntaxKind . Identifier ) {
495
+ declareSymbol ( container . symbol . exports , container . symbol , < Declaration > node , SymbolFlags . Import , SymbolFlags . ImportExcludes ) ;
496
+ }
497
+ else {
498
+ declareSymbol ( container . symbol . exports , container . symbol , < Declaration > node , SymbolFlags . Property , SymbolFlags . PropertyExcludes ) ;
499
+ }
500
+ bindChildren ( node , 0 , /*isBlockScopeContainer*/ false ) ;
501
+ break ;
492
502
case SyntaxKind . SourceFile :
493
503
if ( isExternalModule ( < SourceFile > node ) ) {
494
504
bindAnonymousDeclaration ( < SourceFile > node , SymbolFlags . ValueModule , '"' + removeFileExtension ( ( < SourceFile > node ) . fileName ) + '"' , /*isBlockScopeContainer*/ true ) ;
0 commit comments