TypeScript/tests/baselines/reference/thisInArrowFunctionInStaticInitializer1.js

23 lines
507 B
TypeScript

//// [thisInArrowFunctionInStaticInitializer1.ts]
function log(a) { }
class Vector {
static foo = () => {
// 'this' should not be available in a static initializer.
log(this);
}
}
//// [thisInArrowFunctionInStaticInitializer1.js]
function log(a) { }
var Vector = (function () {
function Vector() {
var _this = this;
}
Vector.foo = function () {
// 'this' should not be available in a static initializer.
log(_this);
};
return Vector;
})();