TypeScript/tests/baselines/reference/objectLitPropertyScoping.errors.txt
2014-09-11 16:11:08 -07:00

20 lines
680 B
Plaintext

==== tests/cases/compiler/objectLitPropertyScoping.ts (2 errors) ====
// Should compile, x and y should not be picked up from the properties
function makePoint(x: number, y: number) {
return {
get x() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
return x;
},
get y() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
return y;
},
dist: function () {
return Math.sqrt(x * x + y * y);
}
}
};