42 lines
1.4 KiB
Text
42 lines
1.4 KiB
Text
|
==== tests/cases/compiler/super_inside-object-literal-getters-and-setters.ts (7 errors) ====
|
||
|
module ObjectLiteral {
|
||
|
var ThisInObjectLiteral = {
|
||
|
_foo: '1',
|
||
|
get foo(): string {
|
||
|
~~~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
return super._foo;
|
||
|
~~~~~
|
||
|
!!! 'super' can only be referenced in a derived class.
|
||
|
},
|
||
|
set foo(value: string) {
|
||
|
~~~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
super._foo = value;
|
||
|
~~~~~
|
||
|
!!! 'super' can only be referenced in a derived class.
|
||
|
},
|
||
|
test: function () {
|
||
|
return super._foo;
|
||
|
~~~~~
|
||
|
!!! 'super' can only be referenced in a derived class.
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class F { public test(): string { return ""; } }
|
||
|
class SuperObjectTest extends F {
|
||
|
public testing() {
|
||
|
var test = {
|
||
|
get F() {
|
||
|
~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
return super.test();
|
||
|
~~~~~
|
||
|
!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|