Uh oh!
There was an error while loading. Please reload this page.
process: argv1 property to preserve original argv[1] - #49918
process: argv1 property to preserve original argv[1]#49918GeoffreyBooth wants to merge 5 commits into
argv1 property to preserve original argv[1]#49918Conversation
nodejs-github-bot
commented
Sep 28, 2023
Review requested:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thinking about the overall concept, I think it would probably make more sense to introduce something like |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
GeoffreyBooth
commented
Sep 29, 2023
Maybe we can do both? It feels wrong to have |
I don't think we really need |
aduh95
commented
Sep 29, 2023
Whatever what name we decide to go with, it'd be very useful to find a way to expose the info to loader thread. |
So it’s the new value of |
Qard
commented
Sep 29, 2023
I'd rather not create a We should be explicit about what we're exposing and why so I feel it should have a better name and, yes, resolving first is probably ideal, for consistency. |
GeoffreyBooth
commented
Sep 29, 2023
It exists because I don’t know what the use cases are for having the input before it gets resolved, and that’s a good argument for not needing |
Qard
commented
Sep 29, 2023
Yes, I'm aware of what |
Uh oh!
There was an error while loading. Please reload this page.
I opened this PR because I was surprised to see that we had If we want to add additional properties like |
joyeecheung
commented
Oct 2, 2023
I don't think having |
GeoffreyBooth
commented
Oct 2, 2023
Because Node doesn’t reassign
Agreed! But what we have is |
This pull request has been marked as stale due to 90 days of inactivity. |
Following up #49869, supporting #49432, this PR creates a new
process.argv1property similar toprocess.argv0.Just as
process.argv0preserves the original value ofargv[0]before Node replaces it with the absolute path to the executable,process.argv1preserves the original value ofargv[1]before Node replaces it with the absolute path to the entry point.There are also some refactors to how some of the “pre-execution” functions interact. I refactored options objects into parameters, as I’m told that generally parameters are faster; and the post-replacement
argv[1]is returned to the caller, rather than the caller relying on theprocess.argv[1]global. I also added some JSDoc and comments. @nodejs/startup