diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index d0a4b2f6ef666d..40592146ada6de 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,