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

15 lines
335 B
TypeScript

// Should compile, x and y should not be picked up from the properties
function makePoint(x: number, y: number) {
return {
get x() {
return x;
},
get y() {
return y;
},
dist: function () {
return Math.sqrt(x * x + y * y);
}
}
};