Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: extract event listener validation as a function #55230

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sungpaks
Copy link
Contributor

@sungpaks sungpaks commented Oct 2, 2024

There was some repetitive logics that validated the existence of eventlisteners.
We now replace this with a single line of, hasEventListener(self, type).

  • self is the object(e.g. EventEmitter) to be checked whether eventlisteners exists or not.
  • type is the type of eventlisteners, which can be undefined

There was some repetitive logics that validated the existence of
eventlisteners. We now replace this with a single line of,
`hasEventListener(self, type)`.
`self` is the object(e.g. EventEmitter) to be checked whether
eventlisteners exists or not.
`type` is the type of eventlisteners, which can be `undefined`
@nodejs-github-bot nodejs-github-bot added events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run. labels Oct 2, 2024
@sungpaks sungpaks force-pushed the has-event-listener-validate-function branch from 8f5fd02 to d7a42a4 Compare October 2, 2024 01:10
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (89a2f56) to head (d7a42a4).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55230      +/-   ##
==========================================
+ Coverage   88.39%   88.40%   +0.01%     
==========================================
  Files         652      652              
  Lines      186565   186565              
  Branches    36046    36042       -4     
==========================================
+ Hits       164916   164935      +19     
+ Misses      14908    14900       -8     
+ Partials     6741     6730      -11     
Files with missing lines Coverage Δ
lib/events.js 99.83% <100.00%> (ø)

... and 21 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants