Skip to content

Commit 2454695

Browse files
rmgindutny
authored andcommitted
lib: noisy deprecation of child_process customFds
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>
1 parent e1fec22 commit 2454695

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/child_process.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,12 +804,15 @@ exports.execFile = function(file /* args, options, callback */) {
804804
return child;
805805
};
806806

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

808813
function _convertCustomFds(options) {
809814
if (options && options.customFds && !options.stdio) {
810-
options.stdio = options.customFds.map(function(fd) {
811-
return fd === -1 ? 'pipe' : fd;
812-
});
815+
_deprecatedCustomFds(options);
813816
}
814817
}
815818

0 commit comments

Comments
 (0)