30 lines
778 B
Plaintext
30 lines
778 B
Plaintext
|
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ====
|
||
|
|
||
|
// error to use accessors in ES3 mode
|
||
|
|
||
|
class C {
|
||
|
get x() {
|
||
|
~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
return 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class D {
|
||
|
set x(v) {
|
||
|
~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var x = {
|
||
|
get a() { return 1 }
|
||
|
~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
}
|
||
|
|
||
|
var y = {
|
||
|
set b(v) { }
|
||
|
~
|
||
|
!!! Accessors are only available when targeting ECMAScript 5 and higher.
|
||
|
}
|