events: make memory leak warning more programatically accessible
Checklist
-
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
events
Description of change
This makes the famous EventEmitter memory leak
warnings occurring when the listener count for a given event exceeds a specified number more programatically accessible, by giving them properties referring to the event emitter instance and the event itself.
This can be useful for debugging the origins of such a warning when the stack itself doesn’t reveal enough information about the event emitter instance itself, e.g. when manual inspection of the already-registered listeners is expected to be useful.
(It seems CI on this has to wait until Jenkins is running smoothly again…)
CI: https://ci.nodejs.org/job/node-test-commit/4794/