1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts (2 errors) ====
class C {
static fn() { return this; }
static get x() { return 1; }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
static set x(v) { }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
constructor(public a: number, private b: number) { }
static foo: string;
}
var r = C.fn();
var r2 = r.x;
var r3 = r.foo;
class D extends C {
bar: string;
}
var r = D.fn();
var r2 = r.x;
var r3 = r.foo;
|