diff options
author | Eduard Bondarenko <eduardbcom@gmail.com> | 2018-12-08 23:50:17 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-12-16 07:22:45 -0800 |
commit | 20770073ba56d2af516cc8fa39527da3e4e01985 (patch) | |
tree | 669994062bd2da60bc58d1798c4000e3f2e86829 /lib/child_process.js | |
parent | 02b66b5b866bd8398e7d815d3715ba3f94a5cf65 (diff) | |
download | node-new-20770073ba56d2af516cc8fa39527da3e4e01985.tar.gz |
child_process: spawn ignores options in case args is undefined
spawn method ignores 3-d argument 'options' in case
the second one 'args' equals to 'undefined'.
Fixes: https://github.com/nodejs/node/issues/24912
PR-URL: https://github.com/nodejs/node/pull/24913
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'lib/child_process.js')
-rw-r--r-- | lib/child_process.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index 711764dba7..222df8aed7 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -403,8 +403,9 @@ function normalizeSpawnArguments(file, args, options) { if (Array.isArray(args)) { args = args.slice(0); - } else if (args !== undefined && - (args === null || typeof args !== 'object')) { + } else if (args == null) { + args = []; + } else if (typeof args !== 'object') { throw new ERR_INVALID_ARG_TYPE('args', 'object', args); } else { options = args; |