src: make Environment optional for RunAtExit#9097
Conversation
Currently, the RunAtExit function definition does not use the Environment parameter. This commit makes the parameter optional and removes it from the call site. I noticed this when trying to figure out how to tackle the TODO for RunAtExit which part of nodejs#4641.
Sorry I got that backward when reading about default parameters and it's exactly like you stated. I'll add this to the declaration in the header and not in the definition. Thanks! |
|
I'm -1 on this change, it leaks an implementation detail into a public header and those tend to be excruciatingly painful to change later on. Which TODO are you trying to address? |
I was looking at this TODO and noticed that the |
|
Ah, so the idea is that There are several ways to skin that cat though. API break, function overload, storing the environment in a thread-local, etc. Writing the code probably won't be that complicated, it's more a matter of figuring out what the best solution long-term is. |
|
@bnoordhuis Thanks, I'll take a closer look and create a new PR for discussion. |

Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
src
Description of change
Currently, the RunAtExit function definition does not use the
Environment parameter. This commit makes the parameter optional
and removes it from the call site.
I noticed this when trying to figure out how to tackle the TODO for
RunAtExit which part of #4641.