TypeScript/tests/baselines/reference/classExpressionLoop.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

23 lines
400 B
TypeScript

//// [classExpressionLoop.ts]
let arr = [];
for (let i = 0; i < 10; ++i) {
arr.push(class C {
prop = i;
});
}
//// [classExpressionLoop.js]
var arr = [];
var _loop_1 = function (i) {
arr.push(/** @class */ (function () {
function C() {
this.prop = i;
}
return C;
}()));
};
for (var i = 0; i < 10; ++i) {
_loop_1(i);
}