Skip to content

fix(hooks): distinguish empty listener names from wildcards - #62764

Open
joshtrichards wants to merge 3 commits into
masterfrom
jtr/fix-hooks-emitter-comps
Open

fix(hooks): distinguish empty listener names from wildcards#62764
joshtrichards wants to merge 3 commits into
masterfrom
jtr/fix-hooks-emitter-comps

Conversation

@joshtrichards

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Fix listener removal when scopes or methods are empty strings by distinguishing explicit values from null wildcards and using strict matching.

Strengthen and extend BasicEmitter coverage for empty scope and method values, wildcard removal, listener isolation, callback removal, and argument forwarding.

TODO

  • Validate tests

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
Replace exception-based removal checks and placeholder assertion counts with explicit invocation assertions.

Verify scope and method isolation after each emission, validate named argument forwarding using a reversed callback signature, and ensure listener removal preserves unrelated registrations.

Cover wildcard removal semantics for all listeners of an event, all methods within a scope, one method across scopes, and a specific callback across every registration.

Assisted-by: Copilot:GPT-5

Signed-off-by: Josh <josh.t.richards@gmail.com>
Add regression coverage for `removeListener()` behavior when scope or method names are empty strings. Verify that empty values are treated as explicit listener names rather than wildcards, while `null` continues to select wildcard removal behavior.

Also cover removal of empty methods across scopes and ensure strict matching does not treat non-string values such as `0` as equivalent to string listener names.

Assisted-by: Copilot:GPT-5

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added bug 2. developing Work in progress labels Aug 1, 2026
@joshtrichards
joshtrichards marked this pull request as ready for review August 1, 2026 17:53
@joshtrichards
joshtrichards requested a review from a team as a code owner August 1, 2026 17:53
@joshtrichards
joshtrichards requested review from icewind1991, leftybournes, provokateurin and salmart-dev and removed request for a team August 1, 2026 17:53
@joshtrichards joshtrichards added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants