TypeScript/tests/cases/compiler/thisInAccessors.ts
2014-07-12 17:30:19 -07:00

30 lines
533 B
TypeScript

// this capture only in getter
class GetterOnly {
get Value() {
var fn = () => this;
return '';
}
set Value(val) {
}
}
// this capture only in setter
class SetterOnly {
get Value() {
return '';
}
set Value(val) {
var fn = () => this;
}
}
// this capture only in both setter and getter
class GetterAndSetter {
get Value() {
var fn = () => this;
return '';
}
set Value(val) {
var fn = () => this;
}
}