-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
Version
v21.2.0
Platform
Darwin COMP-JX471G9FQQ 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64 arm Darwin
Subsystem
streams
What steps will reproduce the bug?
Use stream.eventNames() on a stream and you'll find it reports having event listeners for events which it does not actually have listeners for due to this _events pre-allocation change which released in 21.2.0.
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
stream.eventNames() should only return names of events for which there actually are listeners.
What do you see instead?
All expected event types report having listeners because it's based on Reflect.ownKeys(...) which will see the explicit undefined keys as present and assume that means there are listeners for that event name.
Additional information
No response
lpinca
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.