Permalink
Browse files

child_process: name anonymous functions

Refs: #8913
PR-URL: #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>
  • Loading branch information...
brad-decker authored and Fishrock123 committed Dec 1, 2016
1 parent 573f9db commit fa380321487d1fab518c5b3cfb9e1493aa66001c
Showing with 13 additions and 11 deletions.
  1. +13 −11 lib/child_process.js
View
@@ -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) {

0 comments on commit fa38032

Please sign in to comment.