Browse Source

child_process: name anonymous functions

Refs: https://github.com/nodejs/node/issues/8913
PR-URL: https://github.com/nodejs/node/pull/9880
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
v6
brad-decker 8 years ago
committed by James M Snell
parent
commit
bbed075325
  1. 24
      lib/child_process.js

24
lib/child_process.js

@ -70,10 +70,10 @@ exports._forkChild = function(fd) {
p.open(fd);
p.unref();
const control = setupChannel(process, p);
process.on('newListener', function(name) {
process.on('newListener', function onNewListener(name) {
if (name === 'message' || name === 'disconnect') control.ref();
});
process.on('removeListener', function(name) {
process.on('removeListener', function onRemoveListener(name) {
if (name === 'message' || name === 'disconnect') control.unref();
});
};
@ -247,7 +247,7 @@ exports.execFile = function(file /*, args, options, callback*/) {
}
if (options.timeout > 0) {
timeoutId = setTimeout(function() {
timeoutId = setTimeout(function delayedKill() {
kill();
timeoutId = null;
}, options.timeout);
@ -257,7 +257,7 @@ exports.execFile = function(file /*, args, options, callback*/) {
if (encoding)
child.stdout.setEncoding(encoding);
child.stdout.addListener('data', function(chunk) {
child.stdout.on('data', function onChildStdout(chunk) {
stdoutLen += encoding ? Buffer.byteLength(chunk, encoding) : chunk.length;
if (stdoutLen > options.maxBuffer) {
@ -276,7 +276,7 @@ exports.execFile = function(file /*, args, options, callback*/) {
if (encoding)
child.stderr.setEncoding(encoding);
child.stderr.addListener('data', function(chunk) {
child.stderr.on('data', function onChildStderr(chunk) {
stderrLen += encoding ? Buffer.byteLength(chunk, encoding) : chunk.length;
if (stderrLen > options.maxBuffer) {
@ -297,12 +297,14 @@ exports.execFile = function(file /*, args, options, callback*/) {
return child;
};
var _deprecatedCustomFds = internalUtil.deprecate(function(options) {
options.stdio = options.customFds.map(function(fd) {
return fd === -1 ? 'pipe' : fd;
});
}, 'child_process: options.customFds option is deprecated. ' +
'Use options.stdio instead.');
const _deprecatedCustomFds = internalUtil.deprecate(
function deprecateCustomFds(options) {
options.stdio = options.customFds.map(function mapCustomFds(fd) {
return fd === -1 ? 'pipe' : fd;
});
}, 'child_process: options.customFds option is deprecated. ' +
'Use options.stdio instead.'
);
function _convertCustomFds(options) {
if (options.customFds && !options.stdio) {

Loading…
Cancel
Save