mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
15 lines
419 B
TypeScript
15 lines
419 B
TypeScript
// @target: es2015
|
|
|
|
// Class expression in a loop with a computed property name on an instance field.
|
|
// The class temp variable should be block-scoped (let) to ensure each iteration
|
|
// gets its own binding, matching the behavior when BlockScopedBindingInLoop is set.
|
|
|
|
const array: any[] = [];
|
|
const key = "myKey";
|
|
for (let i = 0; i < 3; i++) {
|
|
array.push(class C {
|
|
[key] = i;
|
|
#field = i;
|
|
});
|
|
}
|