From 4ffbf08db1bab3dc48798db48f089c425f5f3e48 Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Mon, 20 Aug 2018 21:32:31 +0530 Subject: [PATCH] child_process: handling fork( path, undefined / null, obj ) Closes: #20749 --- lib/child_process.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/child_process.js b/lib/child_process.js index 6cce1b09e5654b..7e763695c0d70b 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -69,6 +69,11 @@ exports.fork = function fork(modulePath /* , args, options */) { args = arguments[pos++]; } + if (pos < arguments.length && (arguments[pos] === undefined || + arguments[pos] === null)) { + pos++; + } + if (pos < arguments.length && arguments[pos] != null) { if (typeof arguments[pos] !== 'object') { throw new ERR_INVALID_ARG_VALUE(`arguments[${pos}]`, arguments[pos]);