Skip to content

doc: correct info in child_process.md - #11949

Closed
vsemozhetbyt wants to merge 1 commit into
nodejs:masterfrom
vsemozhetbyt:child_process-md-stdio
Closed

doc: correct info in child_process.md#11949
vsemozhetbyt wants to merge 1 commit into
nodejs:masterfrom
vsemozhetbyt:child_process-md-stdio

Conversation

@vsemozhetbyt

Copy link
Copy Markdown
Contributor
Checklist
Affected core subsystem(s)

doc, child_process

child.stderr, child.stdin, and child.stdout are null, not undefined, if the relevant stdio properties are set to anything other than 'pipe':

console.log(require('child_process').spawn('echo',{stdio: ['ignore','ignore','ignore']}));
ChildProcess {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
_closesNeeded: 1,
_closesGot: 0,
connected: false,
signalCode: null,
exitCode: null,
killed: false,
spawnfile: 'echo',
_handle: Process { owner: [Circular], onexit: [Function], pid: 4252 },
spawnargs: [ 'echo' ],
pid: 4252,
stdin: null,
stdout: null,
stderr: null,
stdio: [ null, null, null ] }

The relevant test checks null values.

@nodejs-github-botnodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations. labels Mar 20, 2017
`child.stderr`, `child.stdin`, and `child.stdout`
are `null`, not `undefined`, if the relevant `stdio` properties
are set to anything other than 'pipe'.
jasnell pushed a commit that referenced this pull request Mar 22, 2017
`child.stderr`, `child.stdin`, and `child.stdout`
are `null`, not `undefined`, if the relevant `stdio` properties
are set to anything other than 'pipe'.
PR-URL: #11949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in 76279cb

@jasnelljasnell closed this Mar 22, 2017
@vsemozhetbyt
vsemozhetbyt deleted the child_process-md-stdio branch March 22, 2017 16:27
@sam-github

Copy link
Copy Markdown
Contributor

@vsemozhetbyt does this need backporting? At what time did it change? Are there unit tests asserting this behaviour?

@vsemozhetbyt

Copy link
Copy Markdown
ContributorAuthor

@sam-github

console.log(`// v8 ${process.versions.node}`);constchild=require('child_process').spawn('echo',{stdio: ['ignore','ignore','ignore']});console.log(child.stdin,child.stdout,child.stderr);
// v8 4.8.1
null null null
// v8 6.10.1
null null null
// v8 7.7.4
null null null
// v8 8.0.0-nightly20170321ab2d49bcac
null null null

There is a test checking the null. It seems it is rather old.

@sam-github

Copy link
Copy Markdown
Contributor

OK, thanks, the docs can be (should be?) backported then, I labelled.

MylesBorins pushed a commit that referenced this pull request Mar 28, 2017
`child.stderr`, `child.stdin`, and `child.stdout`
are `null`, not `undefined`, if the relevant `stdio` properties
are set to anything other than 'pipe'.
PR-URL: #11949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Mar 28, 2017
@italoacasasitaloacasas mentioned this pull request Apr 10, 2017
2 tasks
MylesBorins pushed a commit that referenced this pull request Apr 18, 2017
`child.stderr`, `child.stdin`, and `child.stdout`
are `null`, not `undefined`, if the relevant `stdio` properties
are set to anything other than 'pipe'.
PR-URL: #11949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
`child.stderr`, `child.stdin`, and `child.stdout`
are `null`, not `undefined`, if the relevant `stdio` properties
are set to anything other than 'pipe'.
PR-URL: #11949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
`child.stderr`, `child.stdin`, and `child.stdout`
are `null`, not `undefined`, if the relevant `stdio` properties
are set to anything other than 'pipe'.
PR-URL: nodejs/node#11949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

child_processIssues and PRs related to the child_process subsystem.docIssues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@vsemozhetbyt@jasnell@sam-github@evanlucas@addaleax@cjihrig@MylesBorins@nodejs-github-bot