esm: protect against removal of "beforeExit" event handler#47967
esm: protect against removal of "beforeExit" event handler#47967aduh95 wants to merge 1 commit intonodejs:mainfrom
"beforeExit" event handler#47967Conversation
|
Review requested:
|
|
What problem is this solving? If youβre intending to prevent them from removing the event handler, yet they still can, how is this an improvement? Yes they need to make a different call to do so, but if someone is trying to break things and they still are able to, Iβm not sure weβve achieved anything. |
|
@GeoffreyBooth did you miss the "I'm opening this in case someone has a better solution they'd want to share" part of the OP? |
No, I didnβt. |
|
β¦ wait, why is |
|
I guess we can triage this in "known limitations" |
tbh I'm not sure if that's a good idea, it's still quite brittle because hooks authors could still remove the
removeListenerlistener (e.g. by callingprocess.removeAllListeners()), and at some point there's no way around it β or at least, I didn't find a way. I'm opening this in case someone has a better solution they'd want to share.