TypeScript/tests/baselines/reference/commentsemitComments.js

199 lines
3.9 KiB
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [commentsemitComments.ts]
/** Variable comments*/
var myVariable = 10;
/** function comments*/
function foo(/** parameter comment*/p: number) {
}
/** variable with function type comment*/
var fooVar: () => void;
foo(50);
fooVar();
/**class comment*/
class c {
/** constructor comment*/
constructor() {
}
/** property comment */
public b = 10;
/** function comment */
public myFoo() {
return this.b;
}
/** getter comment*/
public get prop1() {
return this.b;
}
/** setter comment*/
public set prop1(val: number) {
this.b = val;
}
/** overload signature1*/
public foo1(a: number): string;
/** Overload signature 2*/
public foo1(b: string): string;
/** overload implementation signature*/
public foo1(aOrb) {
return aOrb.toString();
}
}
/**instance comment*/
var i = new c();
/** interface comments*/
interface i1 {
/** caller comments*/
(a: number): number;
/** new comments*/
new (b: string);
/**indexer property*/
[a: number]: string;
/** function property;*/
myFoo(/*param prop*/a: number): string;
/** prop*/
prop: string;
}
/**interface instance comments*/
var i1_i: i1;
/** this is module comment*/
module m1 {
/** class b */
export class b {
constructor(public x: number) {
}
}
/// module m2
export module m2 {
}
}
/// this is x
declare var x;
//// [commentsemitComments.js]
/** Variable comments*/
2014-07-13 01:04:16 +02:00
var myVariable = 10;
/** function comments*/
function foo(/** parameter comment*/ p) {
2014-07-13 01:04:16 +02:00
}
/** variable with function type comment*/
2014-07-13 01:04:16 +02:00
var fooVar;
foo(50);
fooVar();
/**class comment*/
2014-07-13 01:04:16 +02:00
var c = (function () {
/** constructor comment*/
2014-07-13 01:04:16 +02:00
function c() {
2014-08-14 15:31:00 +02:00
/** property comment */
2014-07-13 01:04:16 +02:00
this.b = 10;
}
/** function comment */
2014-07-13 01:04:16 +02:00
c.prototype.myFoo = function () {
return this.b;
};
Object.defineProperty(c.prototype, "prop1", {
2014-08-14 15:12:14 +02:00
/** getter comment*/
2014-07-13 01:04:16 +02:00
get: function () {
return this.b;
},
2014-08-14 15:12:14 +02:00
/** setter comment*/
2014-07-13 01:04:16 +02:00
set: function (val) {
this.b = val;
},
enumerable: true,
configurable: true
});
/** overload implementation signature*/
2014-07-13 01:04:16 +02:00
c.prototype.foo1 = function (aOrb) {
return aOrb.toString();
};
return c;
})();
/**instance comment*/
2014-07-13 01:04:16 +02:00
var i = new c();
/**interface instance comments*/
2014-07-13 01:04:16 +02:00
var i1_i;
2014-08-14 15:53:37 +02:00
/** this is module comment*/
2014-07-13 01:04:16 +02:00
var m1;
(function (m1) {
/** class b */
2014-07-13 01:04:16 +02:00
var b = (function () {
function b(x) {
this.x = x;
}
return b;
})();
m1.b = b;
})(m1 || (m1 = {}));
//// [commentsemitComments.d.ts]
/** Variable comments*/
2014-07-12 01:36:06 +02:00
declare var myVariable: number;
/** function comments*/
declare function foo(/** parameter comment*/ p: number): void;
/** variable with function type comment*/
2014-07-12 01:36:06 +02:00
declare var fooVar: () => void;
/**class comment*/
declare class c {
/** constructor comment*/
2014-07-12 01:36:06 +02:00
constructor();
/** property comment */
2014-07-12 01:36:06 +02:00
b: number;
/** function comment */
2014-07-12 01:36:06 +02:00
myFoo(): number;
/** getter comment*/
/** setter comment*/
2014-07-12 01:36:06 +02:00
prop1: number;
/** overload signature1*/
2014-07-12 01:36:06 +02:00
foo1(a: number): string;
/** Overload signature 2*/
2014-07-12 01:36:06 +02:00
foo1(b: string): string;
}
/**instance comment*/
2014-07-12 01:36:06 +02:00
declare var i: c;
/** interface comments*/
interface i1 {
/** caller comments*/
2014-07-12 01:36:06 +02:00
(a: number): number;
/** new comments*/
2014-07-12 01:36:06 +02:00
new (b: string): any;
/**indexer property*/
2014-07-12 01:36:06 +02:00
[a: number]: string;
/** function property;*/
2014-07-12 01:36:06 +02:00
myFoo(a: number): string;
/** prop*/
2014-07-12 01:36:06 +02:00
prop: string;
}
/**interface instance comments*/
2014-07-12 01:36:06 +02:00
declare var i1_i: i1;
/** this is module comment*/
declare module m1 {
/** class b */
class b {
2014-07-12 01:36:06 +02:00
x: number;
constructor(x: number);
}
module m2 {
}
}
2014-07-12 01:36:06 +02:00
declare var x: any;