-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: simplify event target agnostic logic in on and once #34997
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused regarding why the code was the way it was originally lol
Commit Queue failed- Loading data for nodejs/node/pull/34997 ✔ Done loading data for nodejs/node/pull/34997 ----------------------------------- PR info ------------------------------------ Title events: simplify event target agnostic logic in on and once (#34997) Author Denys Otrishko (@lundibundi) Branch lundibundi:improve-events-event-target -> nodejs:master Labels author ready, events Commits 1 - events: simplify event target agnostic logic in on and once Committers 1 - Denys Otrishko PR-URL: https://github.com/nodejs/node/pull/34997 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yongsheng Zhang ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/34997 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yongsheng Zhang -------------------------------------------------------------------------------- ✔ Last GitHub Actions successful ℹ Last Full PR CI on 2020-08-31T19:35:13Z: https://ci.nodejs.org/job/node-test-pull-request/32986/ - Querying data for job/node-test-pull-request/32986/ ✔ Build data downloaded ✔ Last Jenkins CI successful ℹ This PR was created on Mon, 31 Aug 2020 17:45:45 GMT ✔ Approvals: 2 ✔ - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/34997#pullrequestreview-479543094 ✔ - Yongsheng Zhang (@ZYSzys): https://github.com/nodejs/node/pull/34997#pullrequestreview-483128689 -------------------------------------------------------------------------------- ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 34997 ✔ Downloaded patch to /home/runner/work/node/node/.ncu/34997/patch -------------------------------------------------------------------------------- error: patch failed: lib/events.js:793 error: lib/events.js: patch does not apply hint: Use 'git am --show-current-patch=diff' to see the failed patch Applying: events: simplify event target agnostic logic in on and once Patch failed at 0001 events: simplify event target agnostic logic in on and once When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". -------------------------------------------------------------------------------- Applying: events: simplify event target agnostic logic in on and once error: sha1 information is lacking or useless (lib/events.js). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 events: simplify event target agnostic logic in on and once When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". |
PR-URL: #34997 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
Landed in b1831fe |
this doesn't land cleanly on v14.x, should it be backported? |
@ruyadorno these changes were applied on top of other changes related to |
PR-URL: nodejs#34997 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
Event listeners pased 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 [email protected]
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 [email protected]
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 [email protected] PR-URL: #43373 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
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 [email protected] PR-URL: #43373 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
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 [email protected] PR-URL: #43373 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
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 [email protected] PR-URL: #43373 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
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 [email protected] PR-URL: nodejs/node#43373 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesThis simplifies logic related to EventTarget handling and shortens the code.
/cc @nodejs/events @jasnell