Skip to content
Next Next commit
child_process: handling fork( path, undefined / null, obj )
Closes: #20749
  • Loading branch information
shobhitchittora committed Aug 20, 2018
commit 4ffbf08db1bab3dc48798db48f089c425f5f3e48
5 changes: 5 additions & 0 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ exports.fork = function fork(modulePath /* , args, options */) {
args = arguments[pos++];
}

if (pos < arguments.length && (arguments[pos] === undefined ||
Comment thread
shobhitchittora marked this conversation as resolved.
Outdated
arguments[pos] === null)) {
Comment thread
shobhitchittora marked this conversation as resolved.
Outdated
pos++;
}

if (pos < arguments.length && arguments[pos] != null) {
if (typeof arguments[pos] !== 'object') {
throw new ERR_INVALID_ARG_VALUE(`arguments[${pos}]`, arguments[pos]);
Expand Down