@@ -637,21 +637,21 @@ namespace ts {
637637 }
638638 }
639639
640- function emitClassMemberDeclarationFlags ( node : Declaration ) {
641- if ( node . flags & NodeFlags . Private ) {
640+ function emitClassMemberDeclarationFlags ( flags : NodeFlags ) {
641+ if ( flags & NodeFlags . Private ) {
642642 write ( "private " ) ;
643643 }
644- else if ( node . flags & NodeFlags . Protected ) {
644+ else if ( flags & NodeFlags . Protected ) {
645645 write ( "protected " ) ;
646646 }
647647
648- if ( node . flags & NodeFlags . Static ) {
648+ if ( flags & NodeFlags . Static ) {
649649 write ( "static " ) ;
650650 }
651- if ( node . flags & NodeFlags . Readonly ) {
651+ if ( flags & NodeFlags . Readonly ) {
652652 write ( "readonly " ) ;
653653 }
654- if ( node . flags & NodeFlags . Abstract ) {
654+ if ( flags & NodeFlags . Abstract ) {
655655 write ( "abstract " ) ;
656656 }
657657 }
@@ -1077,7 +1077,7 @@ namespace ts {
10771077 }
10781078
10791079 emitJsDocComments ( node ) ;
1080- emitClassMemberDeclarationFlags ( node ) ;
1080+ emitClassMemberDeclarationFlags ( node . flags ) ;
10811081 emitVariableDeclaration ( < VariableDeclaration > node ) ;
10821082 write ( ";" ) ;
10831083 writeLine ( ) ;
@@ -1230,7 +1230,7 @@ namespace ts {
12301230 if ( node === accessors . firstAccessor ) {
12311231 emitJsDocComments ( accessors . getAccessor ) ;
12321232 emitJsDocComments ( accessors . setAccessor ) ;
1233- emitClassMemberDeclarationFlags ( node ) ;
1233+ emitClassMemberDeclarationFlags ( node . flags | ( accessors . setAccessor ? 0 : NodeFlags . Readonly ) ) ;
12341234 writeTextOfNode ( currentText , node . name ) ;
12351235 if ( ! ( node . flags & NodeFlags . Private ) ) {
12361236 accessorWithTypeAnnotation = node ;
@@ -1317,7 +1317,7 @@ namespace ts {
13171317 emitModuleElementDeclarationFlags ( node ) ;
13181318 }
13191319 else if ( node . kind === SyntaxKind . MethodDeclaration ) {
1320- emitClassMemberDeclarationFlags ( node ) ;
1320+ emitClassMemberDeclarationFlags ( node . flags ) ;
13211321 }
13221322 if ( node . kind === SyntaxKind . FunctionDeclaration ) {
13231323 write ( "function " ) ;
@@ -1347,7 +1347,7 @@ namespace ts {
13471347
13481348 if ( node . kind === SyntaxKind . IndexSignature ) {
13491349 // Index signature can have readonly modifier
1350- emitClassMemberDeclarationFlags ( node ) ;
1350+ emitClassMemberDeclarationFlags ( node . flags ) ;
13511351 write ( "[" ) ;
13521352 }
13531353 else {
0 commit comments