events: pass the original listener added by EventEmitter#once to the removeListener handler by DavidCai1111 · Pull Request #6394 · nodejs/node

@addaleax added the events

Issues and PRs related to the events subsystem / EventEmitter.

label

Apr 26, 2016

@DavidCai1111 DavidCai1111 changed the title events: make sure the listener added by EventEmitter#once will only be called once events: pass the original listener added by EventEmitter#once to the removeListener handler

Apr 26, 2016

jasnell pushed a commit that referenced this pull request

Apr 29, 2016
When removing a `once` listener, the listener being passed to
the `removeListener` callback is the wrapper. This unwraps the
listener so that `removeListener` is passed the actual listener.

PR-URL: #6394
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@cjihrig cjihrig added the semver-major

PRs that contain breaking changes and should be released in the next major version.

label

Apr 29, 2016

@cjihrig cjihrig removed the semver-major

PRs that contain breaking changes and should be released in the next major version.

label

Apr 29, 2016

Fishrock123 pushed a commit that referenced this pull request

May 4, 2016
When removing a `once` listener, the listener being passed to
the `removeListener` callback is the wrapper. This unwraps the
listener so that `removeListener` is passed the actual listener.

PR-URL: #6394
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

This was referenced

May 4, 2016

joelostrowski pushed a commit to joelostrowski/node that referenced this pull request

May 4, 2016
When removing a `once` listener, the listener being passed to
the `removeListener` callback is the wrapper. This unwraps the
listener so that `removeListener` is passed the actual listener.

PR-URL: nodejs#6394
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins pushed a commit that referenced this pull request

Nov 22, 2016
When removing a `once` listener, the listener being passed to
the `removeListener` callback is the wrapper. This unwraps the
listener so that `removeListener` is passed the actual listener.

PR-URL: #6394
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>