HaxeFoundation / HaxeFoundation/haxe
ES5 Getter / Setter
Open
enhancement
platform-javascript
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Can we have the get/set features of ES5?
It will allow javascript libs to be compiled and used outside the Haxe scope.
```haxe
//Vector2.hx
public class Vector2 {
public var x : Float;
public var y: Float;
public var length(get,set):Float;
private function get_length() : Float { ... }
private function set_length(v:Float) : Float { ... }
}
```
```js
//Vector2.js
/* ... */
Vector2.prototype = {
get length: this.get_length,
set length: this.set_length,
/*... */
};
```
Contributor guide
Assessment
This issue has not been assessed yet.