facebook/jstransform — pull request #19 by fkling (2014-06-28 23:23:05+00:00)
Title: Add optional getter and setter support for classes

If the transform option `es5` is set to `true`, the class transform will now use `Object.defineProperty(...)` to create getters and setters. Line numbers are preserved.

Example input:
```
class Foo {
static get answer {
return 42;
}

get title() {
return this._title;
}

set title(value) {
this._title = value;
}
```

Example output:

```
function Foo(){"use strict";}
Object.defineProperty(Foo,"answer",{enumerable:true,configurable:true,get:function() {"use strict";
return 42;
}});

Object.defineProperty(Foo.prototype,"title",{enumerable:true,configurable:true,get:function() {"use strict";
return this.$Foo_title;
}});

var ____FooDescr=Object.getOwnPropertyDescriptor(Foo.prototype,"title");Object.defineProperty(Foo.prototype,"title",{enumerable:true,configurable:true,get:____FooDescr.get,set:function(value) {"use strict";
this.$Foo_title = value;
}});
```