As you said, getters are functions that are used to retrieve the values of object properties and setters are functions that are used to set the values of object properties. In you example code, _x
is not an object property.
The spec shows that getterSignature and setterSignature are only allowed in classes and at the top-level of libraries.
The only thing that surprises me is that your set
doesn't produce a syntax error.