TypeScript/tests/baselines/reference/commentsVarDecl.js
Sheetal Nandi 6ab3adfd43 Modified the emitComment logic to handle emitting leading or trailing spaces depending on flags
Leading comments have trailing separator while trailing comments have leading space
This removes the extra trailing space in the trailing comments
2014-08-15 14:32:08 -07:00

100 lines
2.8 KiB
JavaScript

//// [commentsVarDecl.ts]
/** Variable comments*/
var myVariable = 10; // This trailing Comment1
/** This is another variable comment*/
var anotherVariable = 30;
// shouldn't appear
var aVar = "";
/** this is multiline comment
* All these variables are of number type */
var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */
/** Triple slash multiline comment*/
/** another line in the comment*/
/** comment line 2*/
var x = 70; /* multiline trailing comment
this is multiline trailing comment */
/** Triple slash comment on the assignement shouldnt be in .d.ts file*/
x = myVariable;
/** triple slash comment1*/
/** jsdocstyle comment - only this comment should be in .d.ts file*/
var n = 30;
/** var deckaration with comment on type as well*/
var y = /** value comment */ 20;
/// var deckaration with comment on type as well
var yy =
/// value comment
20;
/** comment2 */
var z = /** lambda comment */ (x: number, y: number) => x + y;
var z2: /** type comment*/ (x: number) => string;
var x2 = z2;
var n4: (x: number) => string;
n4 = z2;
//// [commentsVarDecl.js]
/** Variable comments*/
var myVariable = 10; // This trailing Comment1
/** This is another variable comment*/
var anotherVariable = 30;
// shouldn't appear
var aVar = "";
/** this is multiline comment
* All these variables are of number type */
var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */
/** Triple slash multiline comment*/
/** another line in the comment*/
/** comment line 2*/
var x = 70; /* multiline trailing comment
this is multiline trailing comment */
x = myVariable;
/** triple slash comment1*/
/** jsdocstyle comment - only this comment should be in .d.ts file*/
var n = 30;
/** var deckaration with comment on type as well*/
var y = 20;
/// var deckaration with comment on type as well
var yy = 20;
/** comment2 */
var z = function (x, y) { return x + y; };
var z2;
var x2 = z2;
var n4;
n4 = z2;
//// [commentsVarDecl.d.ts]
/** Variable comments*/
declare var myVariable: number;
/** This is another variable comment*/
declare var anotherVariable: number;
declare var aVar: string;
/** this is multiline comment
* All these variables are of number type */
declare var anotherAnotherVariable: number;
/** Triple slash multiline comment*/
/** another line in the comment*/
/** comment line 2*/
declare var x: number;
/** triple slash comment1*/
/** jsdocstyle comment - only this comment should be in .d.ts file*/
declare var n: number;
/** var deckaration with comment on type as well*/
declare var y: number;
declare var yy: number;
/** comment2 */
declare var z: (x: number, y: number) => number;
declare var z2: (x: number) => string;
declare var x2: (x: number) => string;
declare var n4: (x: number) => string;