mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Test cases for trailing comments for functions and methods
This commit is contained in:
@@ -7,7 +7,7 @@ class c1 {
|
||||
/** sum with property*/
|
||||
public p2(/** number to add*/b: number) {
|
||||
return this.p1 + b;
|
||||
}
|
||||
} /* trailing comment of method*/
|
||||
/** getter property*/
|
||||
public get p3() {
|
||||
return this.p2(this.p1);
|
||||
@@ -21,7 +21,7 @@ class c1 {
|
||||
/** sum with property*/
|
||||
private pp2(/** number to add*/b: number) {
|
||||
return this.p1 + b;
|
||||
}
|
||||
} // trailing comment of method
|
||||
/** getter property*/
|
||||
private get pp3() {
|
||||
return this.pp2(this.pp1);
|
||||
@@ -224,7 +224,7 @@ var c1 = (function () {
|
||||
/** sum with property*/
|
||||
c1.prototype.p2 = function (b) {
|
||||
return this.p1 + b;
|
||||
};
|
||||
}; /* trailing comment of method*/
|
||||
Object.defineProperty(c1.prototype, "p3", {
|
||||
/** getter property*/
|
||||
get: function () {
|
||||
@@ -242,7 +242,7 @@ var c1 = (function () {
|
||||
/** sum with property*/
|
||||
c1.prototype.pp2 = function (b) {
|
||||
return this.p1 + b;
|
||||
};
|
||||
}; // trailing comment of method
|
||||
Object.defineProperty(c1.prototype, "pp3", {
|
||||
/** getter property*/
|
||||
get: function () {
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
/** This comment should appear for foo*/
|
||||
function foo() {
|
||||
}
|
||||
} /* trailing comment of function */
|
||||
foo();
|
||||
/** This is comment for function signature*/
|
||||
function fooWithParameters(/** this is comment about a*/a: string,
|
||||
/** this is comment for b*/
|
||||
b: number) {
|
||||
var d = a;
|
||||
}
|
||||
} // trailing comment of function
|
||||
fooWithParameters("a", 10);
|
||||
/** fooFunc
|
||||
* comment
|
||||
@@ -33,19 +33,21 @@ function blah2(a: string /* single line multiple trailing comments */ /* second
|
||||
|
||||
function blah3(a: string // trailing commen single line
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
lambdaFoo = (a, b) => a * b; // This is trailing comment that will not get emitted since we are not emitting statement comments yet
|
||||
|
||||
//// [commentsFunction.js]
|
||||
/** This comment should appear for foo*/
|
||||
function foo() {
|
||||
}
|
||||
} /* trailing comment of function */
|
||||
foo();
|
||||
/** This is comment for function signature*/
|
||||
function fooWithParameters(a,
|
||||
/** this is comment for b*/
|
||||
b) {
|
||||
var d = a;
|
||||
}
|
||||
} // trailing comment of function
|
||||
fooWithParameters("a", 10);
|
||||
/** fooFunc
|
||||
* comment
|
||||
@@ -66,6 +68,7 @@ function blah2(a /* single line multiple trailing comments */ /* second */ ) {
|
||||
function blah3(a // trailing commen single line
|
||||
) {
|
||||
}
|
||||
lambdaFoo = function (a, b) { return a * b; };
|
||||
|
||||
|
||||
//// [commentsFunction.d.ts]
|
||||
|
||||
@@ -9,7 +9,7 @@ class c1 {
|
||||
/** sum with property*/
|
||||
public p2(/** number to add*/b: number) {
|
||||
return this.p1 + b;
|
||||
}
|
||||
} /* trailing comment of method*/
|
||||
/** getter property*/
|
||||
public get p3() {
|
||||
return this.p2(this.p1);
|
||||
@@ -23,7 +23,7 @@ class c1 {
|
||||
/** sum with property*/
|
||||
private pp2(/** number to add*/b: number) {
|
||||
return this.p1 + b;
|
||||
}
|
||||
} // trailing comment of method
|
||||
/** getter property*/
|
||||
private get pp3() {
|
||||
return this.pp2(this.pp1);
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
/** This comment should appear for foo*/
|
||||
function foo() {
|
||||
}
|
||||
} /* trailing comment of function */
|
||||
foo();
|
||||
/** This is comment for function signature*/
|
||||
function fooWithParameters(/** this is comment about a*/a: string,
|
||||
/** this is comment for b*/
|
||||
b: number) {
|
||||
var d = a;
|
||||
}
|
||||
} // trailing comment of function
|
||||
fooWithParameters("a", 10);
|
||||
/** fooFunc
|
||||
* comment
|
||||
@@ -35,4 +35,6 @@ function blah2(a: string /* single line multiple trailing comments */ /* second
|
||||
|
||||
function blah3(a: string // trailing commen single line
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
lambdaFoo = (a, b) => a * b; // This is trailing comment that will not get emitted since we are not emitting statement comments yet
|
||||
Reference in New Issue
Block a user