You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): Reuse one wrapper per listener in bindScopeToEmitter
Minting a fresh wrapper on every registration broke DOM EventTarget semantics:
addEventListener dedupes by (type, callback, capture), so distinct wrapper refs
defeated that idempotency (the listener fired once per call) and capture-aware
removal could drop the wrong wrapper. Reuse a single stable wrapper per listener
and forward the caller's options unchanged: the DOM dedupes correctly and Node's
EventEmitter still counts duplicate registrations (removable one-per-call). This
also subsumes the earlier per-event wrapper stack.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments