TypeScript/tests/baselines/reference/super_inside-object-literal-getters-and-setters.errors.txt

51 lines
2.6 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(5,20): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(8,13): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(11,20): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(20,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts(21,24): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts (7 errors) ====
module ObjectLiteral {
var ThisInObjectLiteral = {
_foo: '1',
get foo(): string {
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
return super._foo;
~~~~~
!!! error TS2335: 'super' can only be referenced in a derived class.
2014-07-13 01:04:16 +02:00
},
set foo(value: string) {
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
super._foo = value;
~~~~~
!!! error TS2335: 'super' can only be referenced in a derived class.
2014-07-13 01:04:16 +02:00
},
test: function () {
return super._foo;
~~~~~
!!! error TS2335: 'super' can only be referenced in a derived class.
2014-07-13 01:04:16 +02:00
}
}
}
class F { public test(): string { return ""; } }
class SuperObjectTest extends F {
public testing() {
var test = {
get F() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
return super.test();
~~~~~
!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
2014-07-13 01:04:16 +02:00
}
};
}
}