@@ -67,6 +67,47 @@ public void Convert(Node node)
6767 return result ;
6868 }
6969
70+ protected internal override object ? VisitAccessorProperty ( AccessorProperty accessorProperty )
71+ {
72+ if ( accessorProperty . Decorators . Count > 0 )
73+ {
74+ _writeContext . SetNodeProperty ( nameof ( accessorProperty . Decorators ) , static node => ref node . As < AccessorProperty > ( ) . Decorators ) ;
75+ VisitAuxiliaryNodeList ( accessorProperty . Decorators , separator : string . Empty ) ;
76+
77+ _writeContext . ClearNodeProperty ( ) ;
78+ }
79+
80+ if ( accessorProperty . Static )
81+ {
82+ _writeContext . SetNodeProperty ( nameof ( accessorProperty . Static ) , static node => node . As < AccessorProperty > ( ) . Static ) ;
83+ Writer . WriteKeyword ( "static" , TokenFlags . SurroundingSpaceRecommended , ref _writeContext ) ;
84+
85+ _writeContext . ClearNodeProperty ( ) ;
86+ }
87+ else
88+ {
89+ Writer . SpaceRecommendedAfterLastToken ( ) ;
90+ }
91+
92+ Writer . WriteKeyword ( "accessor" , TokenFlags . SurroundingSpaceRecommended , ref _writeContext ) ;
93+
94+ _writeContext . SetNodeProperty ( nameof ( accessorProperty . Key ) , static node => node . As < AccessorProperty > ( ) . Key ) ;
95+ VisitPropertyKey ( accessorProperty . Key , accessorProperty . Computed , leadingBracketFlags : TokenFlags . LeadingSpaceRecommended ) ;
96+
97+ if ( accessorProperty . Value is not null )
98+ {
99+ _writeContext . ClearNodeProperty ( ) ;
100+ Writer . WritePunctuator ( "=" , TokenFlags . InBetween | TokenFlags . SurroundingSpaceRecommended , ref _writeContext ) ;
101+
102+ _writeContext . SetNodeProperty ( nameof ( accessorProperty . Value ) , static node => node . As < AccessorProperty > ( ) . Value ) ;
103+ VisitRootExpression ( accessorProperty . Value , RootExpressionFlags ( needsBrackets : ExpressionNeedsBracketsInList ( accessorProperty . Value ) ) ) ;
104+ }
105+
106+ Writer . WritePunctuator ( ";" , TokenFlags . Trailing | TokenFlags . TrailingSpaceRecommended , ref _writeContext ) ;
107+
108+ return accessorProperty ;
109+ }
110+
70111 protected internal override object ? VisitArrayExpression ( ArrayExpression arrayExpression )
71112 {
72113 _writeContext . SetNodeProperty ( nameof ( arrayExpression . Elements ) , static node => ref node . As < ArrayExpression > ( ) . Elements ) ;
@@ -1395,45 +1436,6 @@ binaryExpression.Right is UnaryExpression rightUnaryExpression &&
13951436 return propertyDefinition ;
13961437 }
13971438
1398- protected internal override object ? VisitAccessorProperty ( AccessorProperty accessorProperty )
1399- {
1400- if ( accessorProperty . Decorators . Count > 0 )
1401- {
1402- _writeContext . SetNodeProperty ( nameof ( accessorProperty . Decorators ) , static node => ref node . As < AccessorProperty > ( ) . Decorators ) ;
1403- VisitAuxiliaryNodeList ( accessorProperty . Decorators , separator : string . Empty ) ;
1404-
1405- _writeContext . ClearNodeProperty ( ) ;
1406- }
1407-
1408- if ( accessorProperty . Static )
1409- {
1410- _writeContext . SetNodeProperty ( nameof ( accessorProperty . Static ) , static node => node . As < AccessorProperty > ( ) . Static ) ;
1411- Writer . WriteKeyword ( "static" , TokenFlags . SurroundingSpaceRecommended , ref _writeContext ) ;
1412- }
1413- else
1414- {
1415- Writer . SpaceRecommendedAfterLastToken ( ) ;
1416- }
1417-
1418- Writer . WriteKeyword ( "accessor" , TokenFlags . SurroundingSpaceRecommended , ref _writeContext ) ;
1419-
1420- _writeContext . SetNodeProperty ( nameof ( accessorProperty . Key ) , static node => node . As < AccessorProperty > ( ) . Key ) ;
1421- VisitPropertyKey ( accessorProperty . Key , accessorProperty . Computed , leadingBracketFlags : TokenFlags . LeadingSpaceRecommended ) ;
1422-
1423- if ( accessorProperty . Value is not null )
1424- {
1425- _writeContext . ClearNodeProperty ( ) ;
1426- Writer . WritePunctuator ( "=" , TokenFlags . InBetween | TokenFlags . SurroundingSpaceRecommended , ref _writeContext ) ;
1427-
1428- _writeContext . SetNodeProperty ( nameof ( accessorProperty . Value ) , static node => node . As < AccessorProperty > ( ) . Value ) ;
1429- VisitRootExpression ( accessorProperty . Value , RootExpressionFlags ( needsBrackets : ExpressionNeedsBracketsInList ( accessorProperty . Value ) ) ) ;
1430- }
1431-
1432- Writer . WritePunctuator ( ";" , TokenFlags . Trailing | TokenFlags . TrailingSpaceRecommended , ref _writeContext ) ;
1433-
1434- return accessorProperty ;
1435- }
1436-
14371439 protected internal override object ? VisitRestElement ( RestElement restElement )
14381440 {
14391441 _writeContext . SetNodeProperty ( nameof ( restElement . Argument ) , static node => node . As < RestElement > ( ) . Argument ) ;
0 commit comments