23 lines
440 B
JavaScript
23 lines
440 B
JavaScript
|
//// [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 () {
|
||
|
log(_this);
|
||
|
};
|
||
|
return Vector;
|
||
|
})();
|