162 lines
5.4 KiB
Plaintext
162 lines
5.4 KiB
Plaintext
=== tests/cases/compiler/commentsdoNotEmitComments.ts ===
|
|
|
|
/** Variable comments*/
|
|
var myVariable = 10;
|
|
>myVariable : Symbol(myVariable, Decl(commentsdoNotEmitComments.ts, 2, 3))
|
|
|
|
/** function comments*/
|
|
function foo(/** parameter comment*/p: number) {
|
|
>foo : Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20))
|
|
>p : Symbol(p, Decl(commentsdoNotEmitComments.ts, 5, 13))
|
|
}
|
|
|
|
/** variable with function type comment*/
|
|
var fooVar: () => void;
|
|
>fooVar : Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3))
|
|
|
|
foo(50);
|
|
>foo : Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20))
|
|
|
|
fooVar();
|
|
>fooVar : Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3))
|
|
|
|
/**class comment*/
|
|
class c {
|
|
>c : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
|
|
|
|
/** constructor comment*/
|
|
constructor() {
|
|
}
|
|
|
|
/** property comment */
|
|
public b = 10;
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
|
|
/** function comment */
|
|
public myFoo() {
|
|
>myFoo : Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 20, 18))
|
|
|
|
return this.b;
|
|
>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
}
|
|
|
|
/** getter comment*/
|
|
public get prop1() {
|
|
>prop1 : Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5))
|
|
|
|
return this.b;
|
|
>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
}
|
|
|
|
/** setter comment*/
|
|
public set prop1(val: number) {
|
|
>prop1 : Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5))
|
|
>val : Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21))
|
|
|
|
this.b = val;
|
|
>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5))
|
|
>val : Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21))
|
|
}
|
|
|
|
/** overload signature1*/
|
|
public foo1(a: number): string;
|
|
>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35))
|
|
>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 38, 16))
|
|
|
|
/** Overload signature 2*/
|
|
public foo1(b: string): string;
|
|
>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35))
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 40, 16))
|
|
|
|
/** overload implementation signature*/
|
|
public foo1(aOrb) {
|
|
>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35))
|
|
>aOrb : Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16))
|
|
|
|
return aOrb.toString();
|
|
>aOrb : Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16))
|
|
}
|
|
}
|
|
|
|
/**instance comment*/
|
|
var i = new c();
|
|
>i : Symbol(i, Decl(commentsdoNotEmitComments.ts, 48, 3))
|
|
>c : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9))
|
|
|
|
/** interface comments*/
|
|
interface i1 {
|
|
>i1 : Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16))
|
|
|
|
/** caller comments*/
|
|
(a: number): number;
|
|
>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 53, 5))
|
|
|
|
/** new comments*/
|
|
new (b: string);
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 56, 9))
|
|
|
|
/**indexer property*/
|
|
[a: number]: string;
|
|
>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 59, 5))
|
|
|
|
/** function property;*/
|
|
myFoo(/*param prop*/a: number): string;
|
|
>myFoo : Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 59, 24))
|
|
>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 62, 10))
|
|
|
|
/** prop*/
|
|
prop: string;
|
|
>prop : Symbol(prop, Decl(commentsdoNotEmitComments.ts, 62, 43))
|
|
}
|
|
|
|
/**interface instance comments*/
|
|
var i1_i: i1;
|
|
>i1_i : Symbol(i1_i, Decl(commentsdoNotEmitComments.ts, 69, 3))
|
|
>i1 : Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16))
|
|
|
|
/** this is module comment*/
|
|
module m1 {
|
|
>m1 : Symbol(m1, Decl(commentsdoNotEmitComments.ts, 69, 13))
|
|
|
|
/** class b */
|
|
export class b {
|
|
>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 72, 11))
|
|
|
|
constructor(public x: number) {
|
|
>x : Symbol(x, Decl(commentsdoNotEmitComments.ts, 75, 20))
|
|
|
|
}
|
|
}
|
|
|
|
/// module m2
|
|
export module m2 {
|
|
>m2 : Symbol(m2, Decl(commentsdoNotEmitComments.ts, 78, 5))
|
|
}
|
|
}
|
|
|
|
/// this is x
|
|
declare var x;
|
|
>x : Symbol(x, Decl(commentsdoNotEmitComments.ts, 86, 11))
|
|
|
|
|
|
/** const enum member value comment (generated by TS) */
|
|
const enum color { red, green, blue }
|
|
>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14))
|
|
>red : Symbol(color.red, Decl(commentsdoNotEmitComments.ts, 90, 18))
|
|
>green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23))
|
|
>blue : Symbol(color.blue, Decl(commentsdoNotEmitComments.ts, 90, 30))
|
|
|
|
var shade: color = color.green;
|
|
>shade : Symbol(shade, Decl(commentsdoNotEmitComments.ts, 91, 3))
|
|
>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14))
|
|
>color.green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23))
|
|
>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14))
|
|
>green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23))
|
|
|