Closed
Description
From #5208 (comment) by @Nemikolh
With version
[email protected]
this example:class C { constructor(private N: number) {} foo() { for (let i of [0]) { let f = () => i; this.N = f(); } } }is not correctly transformed. (The
_this
binding is not created)
Specifically the output is:
var C = (function () {
function C(N) {
this.N = N;
}
C.prototype.foo = function () {
var _loop_1 = function(i) {
var f = function () { return i; };
this.N = f();
};
for (var _i = 0, _a = [0]; _i < _a.length; _i++) {
var i = _a[_i];
_loop_1(i);
}
};
return C;
})();