Test cases for trailing comments for functions and methods

This commit is contained in:
Sheetal Nandi
2014-08-15 13:40:48 -07:00
parent f2620a4c3d
commit d8e11e7d25
4 changed files with 19 additions and 14 deletions

View File

@@ -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 () {

View File

@@ -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]

View File

@@ -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);

View File

@@ -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