In JavaScript there is the possibility to create getters and setters the following way:
function MyClass(){ var MyField; this.__defineGetter__(\"MyField\",
Take a look at lookupGetter.