HaxeFoundation / HaxeFoundation/haxe

ES5 Getter / Setter

Open
#5,104 13 comments 2 reactions 1 assignee Claimed by @nadako View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.