From 7d4e8a9a7114d9477238e01703bb10129e5b4ba5 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 9 Aug 2010 03:31:30 +0200 Subject: [PATCH] If no options are given to child_process.spawn, env should default to process.env Regression. --- lib/child_process.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index d19a0c0119..fb5c7fd8d7 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -164,10 +164,11 @@ ChildProcess.prototype.kill = function (sig) { ChildProcess.prototype.spawn = function (path, args, options, customFds) { args = args || []; - options = options || {}; var cwd, env; - if (options.cwd === undefined && options.env === undefined && options.customFds === undefined) { + if (!options || options.cwd === undefined && + options.env === undefined && + options.customFds === undefined) { // Deprecated API: (path, args, options, env, customFds) cwd = ""; env = options || process.env;