Skip to content

Commit

Permalink
lib: noisy deprecation of child_process customFds
Browse files Browse the repository at this point in the history
Use a util.deprecate wrapper to issue warnings like any other
deprecated API. The option has been marked as deprecated in the docs
since v0.5.11.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
rmg authored and indutny committed Jul 10, 2014
1 parent e1fec22 commit 2454695
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/child_process.js
Expand Up @@ -804,12 +804,15 @@ exports.execFile = function(file /* args, options, callback */) {
return child;
};

var _deprecatedCustomFds = util.deprecate(function(options) {
options.stdio = options.customFds.map(function(fd) {
return fd === -1 ? 'pipe' : fd;
});
}, 'child_process: customFds option is deprecated, use stdio instead.');

function _convertCustomFds(options) {
if (options && options.customFds && !options.stdio) {
options.stdio = options.customFds.map(function(fd) {
return fd === -1 ? 'pipe' : fd;
});
_deprecatedCustomFds(options);
}
}

Expand Down

0 comments on commit 2454695

Please sign in to comment.