@@ -3487,6 +3487,9 @@ module ts {
34873487
34883488 if ( ! ( node . flags & NodeFlags . Export ) || isES6ExportedDeclaration ( node ) ) {
34893489 emitStart ( node ) ;
3490+ if ( isES6ExportedDeclaration ( node ) ) {
3491+ write ( "export " ) ;
3492+ }
34903493 write ( "var " ) ;
34913494 emit ( node . name ) ;
34923495 emitEnd ( node ) ;
@@ -3512,10 +3515,7 @@ module ts {
35123515 emitModuleMemberName ( node ) ;
35133516 write ( " = {}));" ) ;
35143517 emitEnd ( node ) ;
3515- if ( isES6ExportedDeclaration ( node ) ) {
3516- emitES6NamedExportForDeclaration ( node ) ;
3517- }
3518- else if ( node . flags & NodeFlags . Export ) {
3518+ if ( ! isES6ExportedDeclaration ( node ) && node . flags & NodeFlags . Export ) {
35193519 writeLine ( ) ;
35203520 emitStart ( node ) ;
35213521 write ( "var " ) ;
@@ -3580,6 +3580,9 @@ module ts {
35803580 }
35813581
35823582 emitStart ( node ) ;
3583+ if ( isES6ExportedDeclaration ( node ) ) {
3584+ write ( "export " ) ;
3585+ }
35833586 write ( "var " ) ;
35843587 emit ( node . name ) ;
35853588 write ( ";" ) ;
@@ -3628,23 +3631,11 @@ module ts {
36283631 emitModuleMemberName ( node ) ;
36293632 write ( " = {}));" ) ;
36303633 emitEnd ( node ) ;
3631- if ( isES6ExportedDeclaration ( node ) ) {
3632- emitES6NamedExportForDeclaration ( node ) ;
3633- }
3634- else if ( languageVersion < ScriptTarget . ES6 && node . name . kind === SyntaxKind . Identifier && node . parent === currentSourceFile ) {
3634+ if ( ! isES6ExportedDeclaration ( node ) && node . name . kind === SyntaxKind . Identifier && node . parent === currentSourceFile ) {
36353635 emitExportMemberAssignments ( < Identifier > node . name ) ;
36363636 }
36373637 }
36383638
3639- function emitES6NamedExportForDeclaration ( node : Declaration ) {
3640- writeLine ( ) ;
3641- emitStart ( node ) ;
3642- write ( "export { " ) ;
3643- emit ( node . name ) ;
3644- write ( " };" ) ;
3645- emitEnd ( node ) ;
3646- }
3647-
36483639 function emitRequire ( moduleName : Expression ) {
36493640 if ( moduleName . kind === SyntaxKind . StringLiteral ) {
36503641 write ( "require(" ) ;
0 commit comments