diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 7ff0832538f1e7..d46a5ce03f09c6 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -366,11 +366,8 @@ ChildProcess.prototype.spawn = function(options) { // Let child process know about opened IPC channel if (options.envPairs === undefined) options.envPairs = []; - else if (!ArrayIsArray(options.envPairs)) { - throw new ERR_INVALID_ARG_TYPE('options.envPairs', - 'Array', - options.envPairs); - } + else + validateArray(options.envPairs, 'options.envPairs'); ArrayPrototypePush(options.envPairs, `NODE_CHANNEL_FD=${ipcFd}`); ArrayPrototypePush(options.envPairs,