1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
=== tests/cases/conformance/constEnums/constEnumPropertyAccess1.ts ===
// constant enum declarations are completely erased in the emitted JavaScript code.
// it is an error to reference a constant enum object in any other context
// than a property access that selects one of the enum's members
const enum G {
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
A = 1,
>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
B = 2,
>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10))
C = A + B,
>C : Symbol(G.C, Decl(constEnumPropertyAccess1.ts, 6, 10))
>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10))
D = A * 2
>D : Symbol(G.D, Decl(constEnumPropertyAccess1.ts, 7, 14))
>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
}
var o: {
>o : Symbol(o, Decl(constEnumPropertyAccess1.ts, 11, 3))
[idx: number]: boolean
>idx : Symbol(idx, Decl(constEnumPropertyAccess1.ts, 12, 5))
} = {
1: true
>1 : Symbol(1, Decl(constEnumPropertyAccess1.ts, 13, 5))
};
var a = G.A;
>a : Symbol(a, Decl(constEnumPropertyAccess1.ts, 17, 3))
>G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
var a1 = G["A"];
>a1 : Symbol(a1, Decl(constEnumPropertyAccess1.ts, 18, 3))
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
>"A" : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
var g = o[G.A];
>g : Symbol(g, Decl(constEnumPropertyAccess1.ts, 19, 3))
>o : Symbol(o, Decl(constEnumPropertyAccess1.ts, 11, 3))
>G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
class C {
>C : Symbol(C, Decl(constEnumPropertyAccess1.ts, 19, 15))
[G.A]() { }
>[G.A] : Symbol(C[G.A], Decl(constEnumPropertyAccess1.ts, 21, 9))
>G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14))
get [G.B]() {
>[G.B] : Symbol(C[G.B], Decl(constEnumPropertyAccess1.ts, 22, 15))
>G.B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10))
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10))
return true;
}
set [G.B](x: number) { }
>[G.B] : Symbol(C[G.B], Decl(constEnumPropertyAccess1.ts, 25, 5))
>G.B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10))
>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0))
>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10))
>x : Symbol(x, Decl(constEnumPropertyAccess1.ts, 26, 14))
}
|