@@ -358,6 +358,9 @@ namespace ts {
358358 return undefined ;
359359 }
360360
361+ // Set emitFlags on the name of the importEqualsDeclaration
362+ // This is so the printer will not substitute the identifier
363+ setNodeEmitFlags ( node . name , NodeEmitFlags . NoSubstitution ) ;
361364 const statements : Statement [ ] = [ ] ;
362365 if ( moduleKind !== ModuleKind . AMD ) {
363366 if ( hasModifier ( node , ModifierFlags . Export ) ) {
@@ -639,6 +642,9 @@ namespace ts {
639642 function visitClassDeclaration ( node : ClassDeclaration ) : VisitResult < Statement > {
640643 const statements : Statement [ ] = [ ] ;
641644 const name = node . name || getGeneratedNameForNode ( node ) ;
645+ // Set emitFlags on the name of the classDeclaration
646+ // This is so that when printer will not substitute the identifier
647+ setNodeEmitFlags ( name , NodeEmitFlags . NoSubstitution ) ;
642648 if ( hasModifier ( node , ModifierFlags . Export ) ) {
643649 statements . push (
644650 createClassDeclaration (
@@ -834,6 +840,9 @@ namespace ts {
834840 // Find the name of the module alias, if there is one
835841 const importAliasName = getLocalNameForExternalImport ( importNode , currentSourceFile ) ;
836842 if ( includeNonAmdDependencies && importAliasName ) {
843+ // Set emitFlags on the name of the classDeclaration
844+ // This is so that when printer will not substitute the identifier
845+ setNodeEmitFlags ( importAliasName , NodeEmitFlags . NoSubstitution ) ;
837846 aliasedModuleNames . push ( externalModuleName ) ;
838847 importAliasNames . push ( createParameter ( importAliasName ) ) ;
839848 }
0 commit comments