|
| 1 | +=== tests/cases/compiler/duplicateObjectLiteralProperty_computedName.ts === |
| 2 | +const t1 = { |
| 3 | +>t1 : Symbol(t1, Decl(duplicateObjectLiteralProperty_computedName.ts, 0, 5)) |
| 4 | + |
| 5 | + 1: 1, |
| 6 | +>1 : Symbol(1, Decl(duplicateObjectLiteralProperty_computedName.ts, 0, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 1, 9)) |
| 7 | + |
| 8 | + [1]: 0 // duplicate |
| 9 | +>[1] : Symbol(1, Decl(duplicateObjectLiteralProperty_computedName.ts, 0, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 1, 9)) |
| 10 | +>1 : Symbol(1, Decl(duplicateObjectLiteralProperty_computedName.ts, 0, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 1, 9)) |
| 11 | +} |
| 12 | + |
| 13 | +const t2 = { |
| 14 | +>t2 : Symbol(t2, Decl(duplicateObjectLiteralProperty_computedName.ts, 5, 5)) |
| 15 | + |
| 16 | + 1: 1, |
| 17 | +>1 : Symbol(1, Decl(duplicateObjectLiteralProperty_computedName.ts, 5, 12)) |
| 18 | + |
| 19 | + [+1]: 0 // duplicate |
| 20 | +>[+1] : Symbol([+1], Decl(duplicateObjectLiteralProperty_computedName.ts, 6, 9)) |
| 21 | +} |
| 22 | + |
| 23 | +const t3 = { |
| 24 | +>t3 : Symbol(t3, Decl(duplicateObjectLiteralProperty_computedName.ts, 10, 5)) |
| 25 | + |
| 26 | + "1": 1, |
| 27 | +>"1" : Symbol("1", Decl(duplicateObjectLiteralProperty_computedName.ts, 10, 12)) |
| 28 | + |
| 29 | + [+1]: 0 // duplicate |
| 30 | +>[+1] : Symbol([+1], Decl(duplicateObjectLiteralProperty_computedName.ts, 11, 11)) |
| 31 | +} |
| 32 | + |
| 33 | +const t4 = { |
| 34 | +>t4 : Symbol(t4, Decl(duplicateObjectLiteralProperty_computedName.ts, 15, 5)) |
| 35 | + |
| 36 | + "+1": 1, |
| 37 | +>"+1" : Symbol("+1", Decl(duplicateObjectLiteralProperty_computedName.ts, 15, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 16, 12)) |
| 38 | + |
| 39 | + [+1]: 0 // two different keys, "+1", "1" |
| 40 | +>[+1] : Symbol("+1", Decl(duplicateObjectLiteralProperty_computedName.ts, 15, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 16, 12)) |
| 41 | +} |
| 42 | + |
| 43 | +const t5 = { |
| 44 | +>t5 : Symbol(t5, Decl(duplicateObjectLiteralProperty_computedName.ts, 20, 5)) |
| 45 | + |
| 46 | + "+1": 1, |
| 47 | +>"+1" : Symbol("+1", Decl(duplicateObjectLiteralProperty_computedName.ts, 20, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 21, 12)) |
| 48 | + |
| 49 | + ["+1"]: 0 // duplicate |
| 50 | +>["+1"] : Symbol("+1", Decl(duplicateObjectLiteralProperty_computedName.ts, 20, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 21, 12)) |
| 51 | +>"+1" : Symbol("+1", Decl(duplicateObjectLiteralProperty_computedName.ts, 20, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 21, 12)) |
| 52 | +} |
| 53 | + |
| 54 | +const t6 = { |
| 55 | +>t6 : Symbol(t6, Decl(duplicateObjectLiteralProperty_computedName.ts, 25, 5)) |
| 56 | + |
| 57 | + "-1": 1, |
| 58 | +>"-1" : Symbol("-1", Decl(duplicateObjectLiteralProperty_computedName.ts, 25, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 26, 12)) |
| 59 | + |
| 60 | + [-1]: 0 // duplicate |
| 61 | +>[-1] : Symbol("-1", Decl(duplicateObjectLiteralProperty_computedName.ts, 25, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 26, 12)) |
| 62 | +} |
| 63 | + |
| 64 | +const t7 = { |
| 65 | +>t7 : Symbol(t7, Decl(duplicateObjectLiteralProperty_computedName.ts, 30, 5)) |
| 66 | + |
| 67 | + "-1": 1, |
| 68 | +>"-1" : Symbol("-1", Decl(duplicateObjectLiteralProperty_computedName.ts, 30, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 31, 12)) |
| 69 | + |
| 70 | + ["-1"]: 0 // duplicate |
| 71 | +>["-1"] : Symbol("-1", Decl(duplicateObjectLiteralProperty_computedName.ts, 30, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 31, 12)) |
| 72 | +>"-1" : Symbol("-1", Decl(duplicateObjectLiteralProperty_computedName.ts, 30, 12), Decl(duplicateObjectLiteralProperty_computedName.ts, 31, 12)) |
| 73 | +} |
| 74 | + |
0 commit comments