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: fix adding abort listener in events.once() #43373

Merged

Conversation

daeyeon
Copy link
Member

@daeyeon daeyeon commented Jun 11, 2022

Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in eventTargetAgnosticAddListener()
and directly passes the given listener to the EventTarget.

IMO, removing the wrapper seems harmless, and the AbortSignal is
seemingly the only EventTarget passed to the function as of now.

Fixes: #43337
Refs: #33659
Refs: #34997

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in `eventTargetAgnosticAddListener()`
and directly passes the given listener to the `EventTarget`.

IMO, removing the wrapper seems harmless, and the `AbortSignal` is
seemingly the only `EventTarget` passed to this function for now.

Fixes: nodejs#43337
Refs: nodejs#33659
Refs: nodejs#34997

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
@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 Jun 11, 2022
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 11, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 11, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@lpinca lpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 14, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 14, 2022
@nodejs-github-bot nodejs-github-bot merged commit f7d73d4 into nodejs:master Jun 14, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in f7d73d4

@daeyeon daeyeon deleted the master.events.once-220611.Sat.417b branch June 14, 2022 22:39
danielleadams pushed a commit that referenced this pull request Jun 16, 2022
Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in `eventTargetAgnosticAddListener()`
and directly passes the given listener to the `EventTarget`.

IMO, removing the wrapper seems harmless, and the `AbortSignal` is
seemingly the only `EventTarget` passed to this function for now.

Fixes: #43337
Refs: #33659
Refs: #34997

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

PR-URL: #43373
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
@danielleadams danielleadams mentioned this pull request Jun 16, 2022
targos pushed a commit that referenced this pull request Jul 12, 2022
Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in `eventTargetAgnosticAddListener()`
and directly passes the given listener to the `EventTarget`.

IMO, removing the wrapper seems harmless, and the `AbortSignal` is
seemingly the only `EventTarget` passed to this function for now.

Fixes: #43337
Refs: #33659
Refs: #34997

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

PR-URL: #43373
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in `eventTargetAgnosticAddListener()`
and directly passes the given listener to the `EventTarget`.

IMO, removing the wrapper seems harmless, and the `AbortSignal` is
seemingly the only `EventTarget` passed to this function for now.

Fixes: #43337
Refs: #33659
Refs: #34997

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

PR-URL: #43373
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in `eventTargetAgnosticAddListener()`
and directly passes the given listener to the `EventTarget`.

IMO, removing the wrapper seems harmless, and the `AbortSignal` is
seemingly the only `EventTarget` passed to this function for now.

Fixes: nodejs/node#43337
Refs: nodejs/node#33659
Refs: nodejs/node#34997

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

PR-URL: nodejs/node#43373
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
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.

events.once leaks signal listener
5 participants