Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
process: argv1 property to preserve original argv[1]#49918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Conversation
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 <[email protected]>
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.
joyeecheung commented Sep 29, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
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 <[email protected]>
GeoffreyBooth commented Sep 29, 2023
Maybe we can do both? It feels wrong to have |
joyeecheung commented Sep 29, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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. |
GeoffreyBooth commented Sep 29, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
GeoffreyBooth commented Oct 1, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
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 |
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