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