This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
child_process: clone spawn options argument #9159
Closed
jasnell
wants to merge
1
commit into
nodejs:v0.12
from
jasnell:v0.12-child_process-clone-spawn-options-argument
Closed
child_process: clone spawn options argument #9159
jasnell
wants to merge
1
commit into
nodejs:v0.12
from
jasnell:v0.12-child_process-clone-spawn-options-argument
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spawnSync() modifies the options argument. This commit makes a copy of options before any modifications occur.
Per: #9158 |
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); |
There was a problem hiding this comment.
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
?
Effectively yes. The intent is to isolate the changes spawnSync makes to options so that those don't bleed out. |
cool. I'm fine with this. |
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>
Landed in b5a0abc |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
spawnSync() modifies the options argument. This commit makes
a copy of options before any modifications occur.