Skip to content

fix: to_js dict key 'size' collides with Map.prototype.size - #134

Open
Alex-PLACET wants to merge 1 commit into
emscripten-forge:mainfrom
Alex-PLACET:fix-to_js-dict-corruption
Open

fix: to_js dict key 'size' collides with Map.prototype.size#134
Alex-PLACET wants to merge 1 commit into
emscripten-forge:mainfrom
Alex-PLACET:fix-to_js-dict-corruption

Conversation

@Alex-PLACET

Copy link
Copy Markdown

The LiteralMap get trap read map[k] before map.get(k), so a stored key named "size" returned Map.prototype.size (the entry count) instead of the stored value. Check map.has(k) first, matching getOwnPropertyDescriptor.

The LiteralMap get trap read map[k] before map.get(k), so a stored key
named "size" returned Map.prototype.size (the entry count) instead of the
stored value. Check map.has(k) first, matching getOwnPropertyDescriptor.

Adds TestPyToJsDict regression tests (test_dict_size_key, int values,
roundtrip). Full browser suite: 88 pytest + 4 async passed.
@Alex-PLACET
Alex-PLACET marked this pull request as ready for review August 27, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant