Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

child_process: clone spawn options argument #9159

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Feb 7, 2015

spawnSync() modifies the options argument. This commit makes
a copy of options before any modifications occur.

spawnSync() modifies the options argument. This commit makes
a copy of options before any modifications occur.
@jasnell
Copy link
Member Author

jasnell commented Feb 7, 2015

Per: #9158

@jasnell
Copy link
Member Author

jasnell commented Mar 5, 2015

cc: @joyent/node-coreteam ... this was a pull over of a change @cjihrig made over in io.js land if I recall correctly.

@@ -960,6 +960,7 @@ function normalizeSpawnArguments(file /*, args, options*/) {
else if (!util.isObject(options))
throw new TypeError('options argument must be an object');

options = util._extend({}, options);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this basically to shallow clone options?

@jasnell
Copy link
Member Author

jasnell commented Mar 5, 2015

Effectively yes. The intent is to isolate the changes spawnSync makes to options so that those don't bleed out.

@trevnorris
Copy link

cool. I'm fine with this.

@jasnell jasnell added this to the 0.12.1 milestone Mar 6, 2015
@misterdjules misterdjules modified the milestones: 0.12.3, 0.12.2 Apr 1, 2015
@misterdjules misterdjules modified the milestones: 0.12.3, 0.12.4 May 14, 2015
@misterdjules misterdjules modified the milestones: 0.12.4, 0.12.5 May 25, 2015
@misterdjules misterdjules modified the milestones: 0.12.5, 0.12.6 Jun 22, 2015
@misterdjules misterdjules modified the milestones: 0.12.6, 0.12.7 Jul 6, 2015
@misterdjules misterdjules modified the milestones: 0.12.6, 0.12.7, 0.12.8 Jul 6, 2015
cjihrig added a commit that referenced this pull request Aug 27, 2015
spawnSync() modifies the options argument. This commit makes
a copy of options before any modifications occur.

PR-URL: #9159
Reviewed-By: trevnorris - Trevor Norris <trev.norris@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Aug 27, 2015

Landed in b5a0abc

@jasnell jasnell closed this Aug 27, 2015
jBarz pushed a commit to ibmruntimes/node that referenced this pull request Nov 4, 2016
spawnSync() modifies the options argument. This commit makes
a copy of options before any modifications occur.

PR-URL: nodejs#9159
Reviewed-By: trevnorris - Trevor Norris <trev.norris@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants