HaxeFoundation / HaxeFoundation/haxe

[js] enum representation: using toString as parameter name overrides the actual value with $estr

Open
#10,294 0 comments 0 reactions 0 assignees View on GitHub
bug platform-javascript
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
enum E {
A(toString:Int);
}
```
leads to this JS output:
```js
var E = $hxEnums["E"] = { __ename__:true,__constructs__:null
,A: ($_=function(toString) { return {_hx_index:0,toString:toString,__enum__:"E",toString:$estr}; },$_._hx_name="A",$_.__params__ = ["toString"],$_)
};
```
https://try.haxe.org/#ED26893C

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.