TypeScript/tests/baselines/reference/typeOfThisInAccessor.errors.txt

42 lines
1.2 KiB
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/typeOfThisInAccessor.ts (5 errors) ====
class C {
get x() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
var r = this; // C
return 1;
}
static get y() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
var r2 = this; // typeof C
return 1;
}
}
class D<T> {
a: T;
get x() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
var r = this; // D<T>
return 1;
}
static get y() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
var r2 = this; // typeof D
return 1;
}
}
var x = {
get a() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
var r3 = this; // any
return 1;
}
}