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

25 lines
426 B
TypeScript

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