File tree Expand file tree Collapse file tree 5 files changed +39
-2
lines changed
tests/baselines/reference Expand file tree Collapse file tree 5 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -2041,8 +2041,10 @@ module ts {
2041
2041
}
2042
2042
2043
2043
function writeJsDocComments ( declaration : Declaration ) {
2044
- var jsDocComments = getJsDocComments ( declaration , currentSourceFile ) ;
2045
- emitComments ( jsDocComments , writer , writeCommentRange ) ;
2044
+ if ( declaration ) {
2045
+ var jsDocComments = getJsDocComments ( declaration , currentSourceFile ) ;
2046
+ emitComments ( jsDocComments , writer , writeCommentRange ) ;
2047
+ }
2046
2048
}
2047
2049
2048
2050
function emitSourceTextOfNode ( node : Node ) {
@@ -2459,6 +2461,8 @@ module ts {
2459
2461
function emitAccessorDeclaration ( node : AccessorDeclaration ) {
2460
2462
var accessors = getAllAccessorDeclarations ( < ClassDeclaration > node . parent , node ) ;
2461
2463
if ( node === accessors . firstAccessor ) {
2464
+ emitJsDocComments ( accessors . getAccessor ) ;
2465
+ emitJsDocComments ( accessors . setAccessor ) ;
2462
2466
emitDeclarationFlags ( node ) ;
2463
2467
emitSourceTextOfNode ( node . name ) ;
2464
2468
if ( ! ( node . flags & NodeFlags . Private ) ) {
Original file line number Diff line number Diff line change @@ -476,15 +476,21 @@ declare class c1 {
476
476
/** p1 is property of c1*/
477
477
p1 : number ;
478
478
p2 ( b : number ) : number ;
479
+ /** getter property*/
480
+ /** setter property*/
479
481
p3 : number ;
480
482
/** pp1 is property of c1*/
481
483
private pp1 ;
482
484
private pp2 ( b ) ;
485
+ /** getter property*/
486
+ /** setter property*/
483
487
private pp3 ;
484
488
constructor ( ) ;
485
489
/** s1 is static property of c1*/
486
490
static s1 : number ;
487
491
static s2 ( b : number ) : number ;
492
+ /** static getter property*/
493
+ /** setter property*/
488
494
static s3 : number ;
489
495
nc_p1 : number ;
490
496
nc_p2 ( b : number ) : number ;
@@ -507,14 +513,22 @@ declare class c1 {
507
513
/** p1 is property of c1 */
508
514
b_p1 : number ;
509
515
b_p2 ( b : number ) : number ;
516
+ /** getter property */
517
+ /** setter property */
510
518
b_p3 : number ;
511
519
/** pp1 is property of c1 */
512
520
private b_pp1 ;
513
521
private b_pp2 ( b ) ;
522
+ /** getter property */
523
+ /** setter property */
514
524
private b_pp3 ;
515
525
/** s1 is static property of c1 */
516
526
static b_s1 : number ;
517
527
static b_s2 ( b : number ) : number ;
528
+ /** static getter property
529
+ */
530
+ /** setter property
531
+ */
518
532
static b_s3 : number ;
519
533
}
520
534
declare var i1: c1 ;
@@ -537,8 +551,10 @@ declare var i1_s_ncprop: number;
537
551
declare var i1_c: typeof c1 ;
538
552
declare class cProperties {
539
553
private val ;
554
+ /** getter only property*/
540
555
p1 : number ;
541
556
nc_p1 : number ;
557
+ /**setter only property*/
542
558
p2 : number ;
543
559
nc_p2 : number ;
544
560
}
Original file line number Diff line number Diff line change @@ -309,13 +309,15 @@ declare class c2 {
309
309
/** c2 c2_p1*/
310
310
c2_p1 : number ;
311
311
c2_f1 ( ) : void ;
312
+ /** c2 c2_prop*/
312
313
c2_prop : number ;
313
314
c2_nc_p1 : number ;
314
315
c2_nc_f1 ( ) : void ;
315
316
c2_nc_prop : number ;
316
317
/** c2 p1*/
317
318
p1 : number ;
318
319
f1 ( ) : void ;
320
+ /** c2 prop*/
319
321
prop : number ;
320
322
nc_p1 : number ;
321
323
nc_f1 ( ) : void ;
@@ -327,6 +329,7 @@ declare class c3 extends c2 {
327
329
/** c3 p1*/
328
330
p1 : number ;
329
331
f1 ( ) : void ;
332
+ /** c3 prop*/
330
333
prop : number ;
331
334
nc_p1 : number ;
332
335
nc_f1 ( ) : void ;
Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ declare class c {
157
157
/** property comment */
158
158
b: number ;
159
159
myFoo ( ) : number ;
160
+ /** getter comment*/
161
+ /** setter comment*/
160
162
prop1: number ;
161
163
foo1 ( a : number ) : string ;
162
164
foo1 ( b : string ) : string ;
Original file line number Diff line number Diff line change @@ -271,8 +271,14 @@ var c2 = (function () {
271
271
//// [declFileAccessors_0.d.ts]
272
272
/** This is comment for c1*/
273
273
export declare class c1 {
274
+ /** getter property*/
275
+ /** setter property*/
274
276
p3 : number ;
277
+ /** private getter property*/
278
+ /** private setter property*/
275
279
private pp3 ;
280
+ /** static getter property*/
281
+ /** setter property*/
276
282
static s3 : number ;
277
283
nc_p3: number ;
278
284
private nc_pp3 ;
@@ -283,8 +289,14 @@ export declare class c1 {
283
289
//// [declFileAccessors_1.d.ts]
284
290
/** This is comment for c2 - the global class*/
285
291
declare class c2 {
292
+ /** getter property*/
293
+ /** setter property*/
286
294
p3 : number ;
295
+ /** private getter property*/
296
+ /** private setter property*/
287
297
private pp3 ;
298
+ /** static getter property*/
299
+ /** setter property*/
288
300
static s3 : number ;
289
301
nc_p3 : number ;
290
302
private nc_pp3 ;
You can’t perform that action at this time.
0 commit comments