TypeScript/tests/baselines/reference/typeOfThisInConstructorParamList.js

18 lines
487 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [typeOfThisInConstructorParamList.ts]
//type of 'this' in constructor param list is the class instance type (error)
class ErrClass {
// Should be an error
constructor(f = this) { }
}
//// [typeOfThisInConstructorParamList.js]
//type of 'this' in constructor param list is the class instance type (error)
2014-07-13 01:04:16 +02:00
var ErrClass = (function () {
// Should be an error
2014-07-13 01:04:16 +02:00
function ErrClass(f) {
if (f === void 0) { f = this; }
}
return ErrClass;
})();