TypeScript/tests/baselines/reference/classExpressionLoop.types
Nathan Shively-Sanders b2d1f537f1
Bloomberg computed property name fix (#43197)
* Fix property name bindings for class expr in loops

* Fix block-scope capturing with prop initializers

Co-authored-by: Joey Watts <joey.watts.96@gmail.com>
2021-03-11 10:32:42 -08:00

30 lines
551 B
Plaintext

=== tests/cases/conformance/classes/classExpressions/classExpressionLoop.ts ===
let arr = [];
>arr : any[]
>[] : undefined[]
for (let i = 0; i < 10; ++i) {
>i : number
>0 : 0
>i < 10 : boolean
>i : number
>10 : 10
>++i : number
>i : number
arr.push(class C {
>arr.push(class C { prop = i; }) : number
>arr.push : (...items: any[]) => number
>arr : any[]
>push : (...items: any[]) => number
>class C { prop = i; } : typeof C
>C : typeof C
prop = i;
>prop : number
>i : number
});
}