Skip to content

Commit fce9b3a

Browse files
puskinaduh95
authored andcommitted
child_process: refactor string validation in exec and spawn
1 parent 68862c4 commit fce9b3a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

lib/child_process.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ function _forkChild(fd, serializationMode) {
189189
}
190190

191191
function normalizeExecArgs(command, options, callback) {
192-
validateString(command, 'command');
193-
validateArgumentNullCheck(command, 'command');
194-
195192
if (typeof options === 'function') {
196193
callback = options;
197194
options = undefined;
@@ -568,9 +565,9 @@ let emittedDEP0190Already = false;
568565
function normalizeSpawnArguments(file, args, options) {
569566
validateString(file, 'file');
570567
validateArgumentNullCheck(file, 'file');
571-
572-
if (file.length === 0)
568+
if (file.length === 0) {
573569
throw new ERR_INVALID_ARG_VALUE('file', file, 'cannot be empty');
570+
}
574571

575572
if (ArrayIsArray(args)) {
576573
args = ArrayPrototypeSlice(args);

0 commit comments

Comments
 (0)