|
| 1 | +//// [tests/cases/compiler/declarationEmitComputedNamesInaccessible.ts] //// |
| 2 | + |
| 3 | +=== declarationEmitComputedNamesInaccessible.ts === |
| 4 | +export function f1() { |
| 5 | +>f1 : Symbol(f1, Decl(declarationEmitComputedNamesInaccessible.ts, 0, 0)) |
| 6 | + |
| 7 | + const localClassFieldName = Math.random() > 0.5 ? "g1" : "g2"; |
| 8 | +>localClassFieldName : Symbol(localClassFieldName, Decl(declarationEmitComputedNamesInaccessible.ts, 1, 9)) |
| 9 | +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) |
| 10 | +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 11 | +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) |
| 12 | + |
| 13 | + const localOtherField = localClassFieldName === "g1" ? "g2" : "g1"; |
| 14 | +>localOtherField : Symbol(localOtherField, Decl(declarationEmitComputedNamesInaccessible.ts, 2, 9)) |
| 15 | +>localClassFieldName : Symbol(localClassFieldName, Decl(declarationEmitComputedNamesInaccessible.ts, 1, 9)) |
| 16 | + |
| 17 | + const localStaticField = Math.random() > 0.5 ? "s1" : "s2"; |
| 18 | +>localStaticField : Symbol(localStaticField, Decl(declarationEmitComputedNamesInaccessible.ts, 3, 9)) |
| 19 | +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) |
| 20 | +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 21 | +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) |
| 22 | + |
| 23 | + return class ParameterizedHolder { |
| 24 | +>ParameterizedHolder : Symbol(ParameterizedHolder, Decl(declarationEmitComputedNamesInaccessible.ts, 4, 10)) |
| 25 | + |
| 26 | + [localClassFieldName]() { |
| 27 | +>[localClassFieldName] : Symbol(ParameterizedHolder[localClassFieldName], Decl(declarationEmitComputedNamesInaccessible.ts, 4, 38)) |
| 28 | +>localClassFieldName : Symbol(localClassFieldName, Decl(declarationEmitComputedNamesInaccessible.ts, 1, 9)) |
| 29 | + |
| 30 | + return "value"; |
| 31 | + } |
| 32 | + [localOtherField]() { |
| 33 | +>[localOtherField] : Symbol(ParameterizedHolder[localOtherField], Decl(declarationEmitComputedNamesInaccessible.ts, 7, 9)) |
| 34 | +>localOtherField : Symbol(localOtherField, Decl(declarationEmitComputedNamesInaccessible.ts, 2, 9)) |
| 35 | + |
| 36 | + return 42; |
| 37 | + } |
| 38 | + static [localStaticField]() { |
| 39 | +>[localStaticField] : Symbol(ParameterizedHolder[localStaticField], Decl(declarationEmitComputedNamesInaccessible.ts, 10, 9)) |
| 40 | +>localStaticField : Symbol(localStaticField, Decl(declarationEmitComputedNamesInaccessible.ts, 3, 9)) |
| 41 | + |
| 42 | + return { static: true }; |
| 43 | +>static : Symbol(static, Decl(declarationEmitComputedNamesInaccessible.ts, 12, 20)) |
| 44 | + } |
| 45 | + static [localStaticField]() { |
| 46 | +>[localStaticField] : Symbol(ParameterizedHolder[localStaticField], Decl(declarationEmitComputedNamesInaccessible.ts, 13, 9)) |
| 47 | +>localStaticField : Symbol(localStaticField, Decl(declarationEmitComputedNamesInaccessible.ts, 3, 9)) |
| 48 | + |
| 49 | + return { static: "sometimes" }; |
| 50 | +>static : Symbol(static, Decl(declarationEmitComputedNamesInaccessible.ts, 15, 20)) |
| 51 | + } |
| 52 | + } |
| 53 | +} |
0 commit comments