-
Notifications
You must be signed in to change notification settings - Fork 30k
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
child_process: refactor normalizeSpawnArguments() #14149
Conversation
Code is not in hot path. Refactor ternary to be more readable if/else block that mirrors analogous code elsewhere in the function. Change string concatenation to template literal.
if (typeof options.shell === 'string') | ||
file = options.shell; | ||
else | ||
file = process.env.comspec || 'cmd.exe'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you touched this. I'm not sure an environment without a comspec
is valid...
@nodejs/platform-windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@refack No, it is not, at least not in the top-level environment. %COMSPEC%
must always be a valid path to an executable acting as the "shell". However, the value of %COMSPEC%
can be modified by users and can be overriden and/or deleted for child processes. Windows will not prevent that, even though it is not intended behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is not in hot path. Refactor ternary to be more readable if/else block that mirrors analogous code elsewhere in the function. Change string concatenation to template literal. PR-URL: nodejs#14149 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Landed in 6d090e1 |
Code is not in hot path. Refactor ternary to be more readable if/else block that mirrors analogous code elsewhere in the function. Change string concatenation to template literal. PR-URL: #14149 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Code is not in hot path. Refactor ternary to be more readable if/else block that mirrors analogous code elsewhere in the function. Change string concatenation to template literal. PR-URL: #14149 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Should this be backported to |
Not sure how this will be received, but it was bugging me, so I changed it for readability:
Code is not in hot path. Refactor ternary to be more readable if/else
block that mirrors analogous code elsewhere in the function. Change
string concatenation to template literal.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
child_process