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

30 lines
617 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;
var array = [];
var _loop_1 = function (i) {
var _b = void 0, _c = void 0;
array.push((_c = /** @class */ (function () {
function C() {
this[_b] = function () { return C; };
}
return C;
}()),
_b = i,
_a = i,
_c[_a] = 100,
_c));
};
for (var i = 0; i < 10; ++i) {
_loop_1(i);
}