TypeScript/tests/cases/compiler/thisInAccessors.ts

30 lines
533 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
// 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;
}
}