-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
src: add function to reset arguments to default #22192
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
Conversation
The big issue here is that this is more of a band-aid than a real solution – most of these options shouldn’t actually be global state. So while we can land this, we should probably mark it very clearly as an API that is going to be removed or broken as soon as we can do so… |
@addaleax, OK. Then, I think, it may be good to move options to |
I tried making some improvements to this before and ran into some roadblocks. Can give it another try. Like @addaleax, I'm thinking the approach taken in this PR is more of a bandaid quick fix. |
@Let0s The thing is, some options are global (per-process), some are per-Isolate, some are per-Environment. I can probably help with triaging them into the different categories, but … it’s not obvious how to best implement the result. |
@Let0s I’ll take another stab at refactoring some of our options code tomorrow and let you know how that goes. :) |
@addaleax since you refactored a lot of the options recently: is this resolved with that as well? |
No, but it’s easier to do properly now… I can try to get to it within the next days. |
This needs a rebase |
@Let0s Could you provide a minimal example that reproduces this? Would like to make a unit test and try and fix this |
@empyrical I can't write example now, but idea is following:
|
Oh, I get it now. Thanks! |
This needs a rebase now! |
@jasnell I’m labelling this |
@addaleax I saw changes and I don't think if my PR is still useful. Only if make function, that will reset options, for each options class. Or maybe it will be better to re-create |
Embedder can initialize nodejs to run scripts few times with different arguments. But if arguments from old launch weren't restored to theirs default values, nodejs can launch wrong next time. This function allows to reset arguments, which was impossible for embedder without modifying nodejs source code. Fixes: nodejs#21653
… function to reset Node options.
62ceb16
to
70919ae
Compare
This seems to be outdated and if I understand the comments above is not necessary anymore. Thus, I close this. @Let0s thanks a lot for your contribution nevertheless! If I closed this by mistake, please just open a new PR or leave a comment. |
Embedder can initialize nodejs to run scripts few times with different
arguments. But if arguments from old launch weren't restored to theirs
default values, nodejs can launch wrong next time.
This function allows to reset arguments, which was impossible
for embedder without modifying nodejs source code.
Fixes: #21653
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes