lib: noisy deprecation of child_process customFds
authorRyan Graham <r.m.graham@gmail.com>
Tue, 8 Jul 2014 00:04:42 +0000 (17:04 -0700)
committerFedor Indutny <fedor@indutny.com>
Thu, 10 Jul 2014 12:07:07 +0000 (15:07 +0300)
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>
lib/child_process.js

index ac8de76..7bcd6d9 100644 (file)
@@ -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);
   }
 }