HaxeFoundation / HaxeFoundation/haxe

[js] ObjectMap<String, {}> Cannot create property '__id__'

Open
#10,510 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Source code:
```haxe
class Test {
static function main() {
var map = new haxe.ds.ObjectMap();
map.set('abc', {});
trace(map);
}
}
```

Error:
```
Uncaught TypeError: Cannot create property '__id__' on string 'abc',https://try.haxe.org/program/d09d3Dc8/run?r=0.10555269501561204,line:23
```
All Haxe versions

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Test.main reproduction through the linked try.haxe.org example and inspect the generated JavaScript for ObjectMap. Trace why setting the string key attempts to create __id__ on the key, then confirm the corrected behavior by rerunning the example without the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.