TypeScript/tests/baselines/reference/computedPropertyNames52(target=es2015).js
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

26 lines
488 B
TypeScript

//// [computedPropertyNames52.js]
const array = [];
for (let i = 0; i < 10; ++i) {
array.push(class C {
[i] = () => C;
static [i] = 100;
})
}
//// [computedPropertyNames52-emit.js]
var _a;
const array = [];
for (let i = 0; i < 10; ++i) {
let _b, _c;
array.push((_c = class C {
constructor() {
this[_b] = () => C;
}
},
_b = i,
_a = i,
_c[_a] = 100,
_c));
}