TypeScript/tests/baselines/reference/typeOfThisInConstructorParamList.js
2014-08-14 06:42:18 -07:00

18 lines
487 B
TypeScript

//// [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)
var ErrClass = (function () {
// Should be an error
function ErrClass(f) {
if (f === void 0) { f = this; }
}
return ErrClass;
})();