File tree Expand file tree Collapse file tree
src/compiler/transformers/module Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -755,11 +755,20 @@ namespace ts {
755755 else if ( declaration . kind === SyntaxKind . ImportSpecifier ) {
756756 const name = ( < ImportSpecifier > declaration ) . propertyName
757757 || ( < ImportSpecifier > declaration ) . name ;
758- return createPropertyAccess (
759- getGeneratedNameForNode ( declaration . parent . parent . parent ) ,
760- getSynthesizedClone ( name ) ,
761- /*location*/ node
762- ) ;
758+ if ( name . originalKeywordKind === SyntaxKind . DefaultKeyword && languageVersion <= ScriptTarget . ES3 ) {
759+ return createElementAccess (
760+ getGeneratedNameForNode ( declaration . parent . parent . parent ) ,
761+ createLiteral ( name . text ) ,
762+ /*location*/ node
763+ ) ;
764+ }
765+ else {
766+ return createPropertyAccess (
767+ getGeneratedNameForNode ( declaration . parent . parent . parent ) ,
768+ getSynthesizedClone ( name ) ,
769+ /*location*/ node
770+ ) ;
771+ }
763772 }
764773 }
765774 }
@@ -791,7 +800,7 @@ namespace ts {
791800
792801 function createExportAssignment ( name : Identifier , value : Expression ) {
793802 return createAssignment (
794- name . originalKeywordKind && languageVersion === ScriptTarget . ES3
803+ name . originalKeywordKind === SyntaxKind . DefaultKeyword && languageVersion === ScriptTarget . ES3
795804 ? createElementAccess (
796805 createIdentifier ( "exports" ) ,
797806 createLiteral ( name . text )
You can’t perform that action at this time.
0 commit comments