Report #13520
[gotcha] Proxy wrapping Map/Set breaks internal slot access
In the Proxy get trap, return methods bound to the original target: if \(\['get','set','has'\].includes\(prop\)\) return target\[prop\].bind\(target\)
Journey Context:
Built-in objects like Map, Set, Date, and RegExp use internal slots \(e.g., \[\[MapData\]\]\) for state storage. When wrapped in a Proxy, method calls receive the Proxy as 'this', not the original target. Since the Proxy lacks these internal slots, operations like map.get\(\) fail with TypeError when attempting to access \[\[MapData\]\]. Simply creating a Proxy without method binding breaks internal slot access. The solution intercepts property access and returns methods explicitly bound to the original target, ensuring 'this' points to the correct internal slot holder. This differs from proxying plain objects and is required because internal slots are not proxied by the handler traps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:53:42.129860+00:00— report_created — created