247 lines
6 KiB
Text
247 lines
6 KiB
Text
=== tests/cases/compiler/vardecl.ts ===
|
|
var simpleVar;
|
|
>simpleVar : Symbol(simpleVar, Decl(vardecl.ts, 0, 3))
|
|
|
|
var anotherVar: any;
|
|
>anotherVar : Symbol(anotherVar, Decl(vardecl.ts, 2, 3))
|
|
|
|
var varWithSimpleType: number;
|
|
>varWithSimpleType : Symbol(varWithSimpleType, Decl(vardecl.ts, 3, 3))
|
|
|
|
var varWithArrayType: number[];
|
|
>varWithArrayType : Symbol(varWithArrayType, Decl(vardecl.ts, 4, 3))
|
|
|
|
var varWithInitialValue = 30;
|
|
>varWithInitialValue : Symbol(varWithInitialValue, Decl(vardecl.ts, 6, 3))
|
|
|
|
var withComplicatedValue = { x: 30, y: 70, desc: "position" };
|
|
>withComplicatedValue : Symbol(withComplicatedValue, Decl(vardecl.ts, 8, 3))
|
|
>x : Symbol(x, Decl(vardecl.ts, 8, 28))
|
|
>y : Symbol(y, Decl(vardecl.ts, 8, 35))
|
|
>desc : Symbol(desc, Decl(vardecl.ts, 8, 42))
|
|
|
|
declare var declaredVar;
|
|
>declaredVar : Symbol(declaredVar, Decl(vardecl.ts, 10, 11))
|
|
|
|
declare var declareVar2
|
|
>declareVar2 : Symbol(declareVar2, Decl(vardecl.ts, 11, 11))
|
|
|
|
declare var declaredVar3;
|
|
>declaredVar3 : Symbol(declaredVar3, Decl(vardecl.ts, 13, 11))
|
|
|
|
declare var deckareVarWithType: number;
|
|
>deckareVarWithType : Symbol(deckareVarWithType, Decl(vardecl.ts, 14, 11))
|
|
|
|
var arrayVar: string[] = ['a', 'b'];
|
|
>arrayVar : Symbol(arrayVar, Decl(vardecl.ts, 16, 3))
|
|
|
|
var complicatedArrayVar: { x: number; y: string; }[] ;
|
|
>complicatedArrayVar : Symbol(complicatedArrayVar, Decl(vardecl.ts, 18, 3))
|
|
>x : Symbol(x, Decl(vardecl.ts, 18, 26))
|
|
>y : Symbol(y, Decl(vardecl.ts, 18, 37))
|
|
|
|
complicatedArrayVar.push({ x: 30, y : 'hello world' });
|
|
>complicatedArrayVar.push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
>complicatedArrayVar : Symbol(complicatedArrayVar, Decl(vardecl.ts, 18, 3))
|
|
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
>x : Symbol(x, Decl(vardecl.ts, 19, 26))
|
|
>y : Symbol(y, Decl(vardecl.ts, 19, 33))
|
|
|
|
var n1: { [s: string]: number; };
|
|
>n1 : Symbol(n1, Decl(vardecl.ts, 21, 3))
|
|
>s : Symbol(s, Decl(vardecl.ts, 21, 11))
|
|
|
|
var c : {
|
|
>c : Symbol(c, Decl(vardecl.ts, 23, 3))
|
|
|
|
new? (): any;
|
|
>new : Symbol(new, Decl(vardecl.ts, 23, 9))
|
|
}
|
|
|
|
var d: {
|
|
>d : Symbol(d, Decl(vardecl.ts, 27, 3))
|
|
|
|
foo? (): {
|
|
>foo : Symbol(foo, Decl(vardecl.ts, 27, 8))
|
|
|
|
x: number;
|
|
>x : Symbol(x, Decl(vardecl.ts, 28, 14))
|
|
|
|
};
|
|
}
|
|
|
|
var d3: {
|
|
>d3 : Symbol(d3, Decl(vardecl.ts, 33, 3))
|
|
|
|
foo(): {
|
|
>foo : Symbol(foo, Decl(vardecl.ts, 33, 9))
|
|
|
|
x: number;
|
|
>x : Symbol(x, Decl(vardecl.ts, 34, 12))
|
|
|
|
y: number;
|
|
>y : Symbol(y, Decl(vardecl.ts, 35, 18))
|
|
|
|
};
|
|
}
|
|
|
|
var d2: {
|
|
>d2 : Symbol(d2, Decl(vardecl.ts, 40, 3))
|
|
|
|
foo (): {
|
|
>foo : Symbol(foo, Decl(vardecl.ts, 40, 9))
|
|
|
|
x: number;
|
|
>x : Symbol(x, Decl(vardecl.ts, 41, 13))
|
|
|
|
};
|
|
}
|
|
|
|
var n2: {
|
|
>n2 : Symbol(n2, Decl(vardecl.ts, 46, 3))
|
|
|
|
(): void;
|
|
}
|
|
var n4: {
|
|
>n4 : Symbol(n4, Decl(vardecl.ts, 49, 3))
|
|
|
|
(): void;
|
|
}[];
|
|
|
|
var d4: {
|
|
>d4 : Symbol(d4, Decl(vardecl.ts, 53, 3))
|
|
|
|
foo(n: string, x: { x: number; y: number; }): {
|
|
>foo : Symbol(foo, Decl(vardecl.ts, 53, 9))
|
|
>n : Symbol(n, Decl(vardecl.ts, 54, 8))
|
|
>x : Symbol(x, Decl(vardecl.ts, 54, 18))
|
|
>x : Symbol(x, Decl(vardecl.ts, 54, 23))
|
|
>y : Symbol(y, Decl(vardecl.ts, 54, 34))
|
|
|
|
x: number;
|
|
>x : Symbol(x, Decl(vardecl.ts, 54, 51))
|
|
|
|
y: number;
|
|
>y : Symbol(y, Decl(vardecl.ts, 55, 18))
|
|
|
|
};
|
|
}
|
|
|
|
module m2 {
|
|
>m2 : Symbol(m2, Decl(vardecl.ts, 58, 1))
|
|
|
|
export var a, b2: number = 10, b;
|
|
>a : Symbol(a, Decl(vardecl.ts, 62, 14))
|
|
>b2 : Symbol(b2, Decl(vardecl.ts, 62, 17))
|
|
>b : Symbol(b, Decl(vardecl.ts, 62, 34))
|
|
|
|
var m1;
|
|
>m1 : Symbol(m1, Decl(vardecl.ts, 63, 7))
|
|
|
|
var a2, b22: number = 10, b222;
|
|
>a2 : Symbol(a2, Decl(vardecl.ts, 64, 7))
|
|
>b22 : Symbol(b22, Decl(vardecl.ts, 64, 11))
|
|
>b222 : Symbol(b222, Decl(vardecl.ts, 64, 29))
|
|
|
|
var m3;
|
|
>m3 : Symbol(m3, Decl(vardecl.ts, 65, 7))
|
|
|
|
class C {
|
|
>C : Symbol(C, Decl(vardecl.ts, 65, 11))
|
|
|
|
constructor (public b) {
|
|
>b : Symbol(C.b, Decl(vardecl.ts, 68, 21))
|
|
}
|
|
}
|
|
|
|
export class C2 {
|
|
>C2 : Symbol(C2, Decl(vardecl.ts, 70, 5))
|
|
|
|
constructor (public b) {
|
|
>b : Symbol(C2.b, Decl(vardecl.ts, 73, 21))
|
|
}
|
|
}
|
|
var m;
|
|
>m : Symbol(m, Decl(vardecl.ts, 76, 7))
|
|
|
|
declare var d1, d2;
|
|
>d1 : Symbol(d1, Decl(vardecl.ts, 77, 15))
|
|
>d2 : Symbol(d2, Decl(vardecl.ts, 77, 19))
|
|
|
|
var b23;
|
|
>b23 : Symbol(b23, Decl(vardecl.ts, 78, 7))
|
|
|
|
declare var v1;
|
|
>v1 : Symbol(v1, Decl(vardecl.ts, 79, 15))
|
|
|
|
export var mE;
|
|
>mE : Symbol(mE, Decl(vardecl.ts, 80, 14))
|
|
|
|
export declare var d1E, d2E;
|
|
>d1E : Symbol(d1E, Decl(vardecl.ts, 81, 22))
|
|
>d2E : Symbol(d2E, Decl(vardecl.ts, 81, 27))
|
|
|
|
export var b2E;
|
|
>b2E : Symbol(b2E, Decl(vardecl.ts, 82, 14))
|
|
|
|
export declare var v1E;
|
|
>v1E : Symbol(v1E, Decl(vardecl.ts, 83, 22))
|
|
}
|
|
|
|
var a22, b22 = 10, c22 = 30;
|
|
>a22 : Symbol(a22, Decl(vardecl.ts, 86, 3))
|
|
>b22 : Symbol(b22, Decl(vardecl.ts, 86, 8))
|
|
>c22 : Symbol(c22, Decl(vardecl.ts, 86, 18))
|
|
|
|
var nn;
|
|
>nn : Symbol(nn, Decl(vardecl.ts, 87, 3))
|
|
|
|
declare var da1, da2;
|
|
>da1 : Symbol(da1, Decl(vardecl.ts, 89, 11))
|
|
>da2 : Symbol(da2, Decl(vardecl.ts, 89, 16))
|
|
|
|
var normalVar;
|
|
>normalVar : Symbol(normalVar, Decl(vardecl.ts, 90, 3))
|
|
|
|
declare var dv1;
|
|
>dv1 : Symbol(dv1, Decl(vardecl.ts, 91, 11))
|
|
|
|
var xl;
|
|
>xl : Symbol(xl, Decl(vardecl.ts, 92, 3))
|
|
|
|
var x;
|
|
>x : Symbol(x, Decl(vardecl.ts, 93, 3))
|
|
|
|
var z;
|
|
>z : Symbol(z, Decl(vardecl.ts, 94, 3))
|
|
|
|
function foo(a2) {
|
|
>foo : Symbol(foo, Decl(vardecl.ts, 94, 6))
|
|
>a2 : Symbol(a2, Decl(vardecl.ts, 96, 13))
|
|
|
|
var a = 10;
|
|
>a : Symbol(a, Decl(vardecl.ts, 97, 7))
|
|
}
|
|
|
|
for (var i = 0, j = 0; i < 10; i++) {
|
|
>i : Symbol(i, Decl(vardecl.ts, 100, 8))
|
|
>j : Symbol(j, Decl(vardecl.ts, 100, 15))
|
|
>i : Symbol(i, Decl(vardecl.ts, 100, 8))
|
|
>i : Symbol(i, Decl(vardecl.ts, 100, 8))
|
|
|
|
j++;
|
|
>j : Symbol(j, Decl(vardecl.ts, 100, 15))
|
|
}
|
|
|
|
|
|
for (var k = 0; k < 30; k++) {
|
|
>k : Symbol(k, Decl(vardecl.ts, 105, 8))
|
|
>k : Symbol(k, Decl(vardecl.ts, 105, 8))
|
|
>k : Symbol(k, Decl(vardecl.ts, 105, 8))
|
|
|
|
k++;
|
|
>k : Symbol(k, Decl(vardecl.ts, 105, 8))
|
|
}
|
|
var b = 10;
|
|
>b : Symbol(b, Decl(vardecl.ts, 108, 3))
|
|
|