|
| 1 | +//// [tests/cases/compiler/computedPropertyBindingElementDeclarationNoCrash1.ts] //// |
| 2 | + |
| 3 | +=== computedPropertyBindingElementDeclarationNoCrash1.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/61351 |
| 5 | + |
| 6 | +export type State = { |
| 7 | +>State : Symbol(State, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 0, 0)) |
| 8 | + |
| 9 | + a: number; |
| 10 | +>a : Symbol(a, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 2, 21)) |
| 11 | + |
| 12 | + b: string; |
| 13 | +>b : Symbol(b, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 3, 12)) |
| 14 | + |
| 15 | +}; |
| 16 | + |
| 17 | +export class Test { |
| 18 | +>Test : Symbol(Test, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 5, 2)) |
| 19 | + |
| 20 | + setState(state: State) {} |
| 21 | +>setState : Symbol(Test.setState, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 7, 19)) |
| 22 | +>state : Symbol(state, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 8, 11)) |
| 23 | +>State : Symbol(State, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 0, 0)) |
| 24 | + |
| 25 | + test = (e: any) => { |
| 26 | +>test : Symbol(Test.test, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 8, 27)) |
| 27 | +>e : Symbol(e, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 9, 10)) |
| 28 | + |
| 29 | + for (const [key, value] of Object.entries(e)) { |
| 30 | +>key : Symbol(key, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 16)) |
| 31 | +>value : Symbol(value, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 20)) |
| 32 | +>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) |
| 33 | +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 34 | +>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) |
| 35 | +>e : Symbol(e, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 9, 10)) |
| 36 | + |
| 37 | + this.setState({ |
| 38 | +>this.setState : Symbol(Test.setState, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 7, 19)) |
| 39 | +>this : Symbol(Test, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 5, 2)) |
| 40 | +>setState : Symbol(Test.setState, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 7, 19)) |
| 41 | + |
| 42 | + [key]: value, |
| 43 | +>[key] : Symbol([key], Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 11, 21)) |
| 44 | +>key : Symbol(key, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 16)) |
| 45 | +>value : Symbol(value, Decl(computedPropertyBindingElementDeclarationNoCrash1.ts, 10, 20)) |
| 46 | + |
| 47 | + }); |
| 48 | + } |
| 49 | + }; |
| 50 | +} |
| 51 | + |
0 commit comments