summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEduard Bondarenko <eduardbcom@gmail.com>2018-12-08 23:50:17 +0200
committerRich Trott <rtrott@gmail.com>2018-12-16 07:22:45 -0800
commit20770073ba56d2af516cc8fa39527da3e4e01985 (patch)
tree669994062bd2da60bc58d1798c4000e3f2e86829 /lib
parent02b66b5b866bd8398e7d815d3715ba3f94a5cf65 (diff)
downloadandroid-node-v8-20770073ba56d2af516cc8fa39527da3e4e01985.tar.gz
android-node-v8-20770073ba56d2af516cc8fa39527da3e4e01985.tar.bz2
android-node-v8-20770073ba56d2af516cc8fa39527da3e4e01985.zip
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')
-rw-r--r--lib/child_process.js5
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;