Skip to content

Commit a9092c3

Browse files
committed
Test cases for trailing comments for class and constructor
1 parent f1df758 commit a9092c3

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tests/baselines/reference/commentsClass.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
/** This is class c2 without constuctor*/
44
class c2 {
5-
}
5+
} // trailing comment1
66
var i2 = new c2();
77
var i2_c = c2;
88
class c3 {
99
/** Constructor comment*/
1010
constructor() {
11-
}
12-
}
11+
} // trailing comment of constructor
12+
} /* trailing comment 2 */
1313
var i3 = new c3();
1414
var i3_c = c3;
1515
/** Class comment*/
1616
class c4 {
1717
/** Constructor comment*/
1818
constructor() {
19-
}
19+
} /* trailing comment of constructor 2*/
2020
}
2121
var i4 = new c4();
2222
var i4_c = c4;
@@ -71,22 +71,22 @@ var c2 = (function () {
7171
function c2() {
7272
}
7373
return c2;
74-
})();
74+
})(); // trailing comment1
7575
var i2 = new c2();
7676
var i2_c = c2;
7777
var c3 = (function () {
7878
/** Constructor comment*/
7979
function c3() {
80-
}
80+
} // trailing comment of constructor
8181
return c3;
82-
})();
82+
})(); /* trailing comment 2 */
8383
var i3 = new c3();
8484
var i3_c = c3;
8585
/** Class comment*/
8686
var c4 = (function () {
8787
/** Constructor comment*/
8888
function c4() {
89-
}
89+
} /* trailing comment of constructor 2*/
9090
return c4;
9191
})();
9292
var i4 = new c4();

tests/cases/compiler/commentsClass.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44

55
/** This is class c2 without constuctor*/
66
class c2 {
7-
}
7+
} // trailing comment1
88
var i2 = new c2();
99
var i2_c = c2;
1010
class c3 {
1111
/** Constructor comment*/
1212
constructor() {
13-
}
14-
}
13+
} // trailing comment of constructor
14+
} /* trailing comment 2 */
1515
var i3 = new c3();
1616
var i3_c = c3;
1717
/** Class comment*/
1818
class c4 {
1919
/** Constructor comment*/
2020
constructor() {
21-
}
21+
} /* trailing comment of constructor 2*/
2222
}
2323
var i4 = new c4();
2424
var i4_c = c4;

0 commit comments

Comments
 (0)