util: mark util.pump() as deprecated
authorBen Noordhuis <info@bnoordhuis.nl>
Sun, 5 Aug 2012 21:31:28 +0000 (23:31 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Sun, 5 Aug 2012 21:40:28 +0000 (23:40 +0200)
doc/api/util.markdown
lib/util.js

index 8b16cad..165cdf3 100644 (file)
@@ -170,7 +170,7 @@ Returns `true` if the given "object" is an `Error`. `false` otherwise.
 
 ## util.pump(readableStream, writableStream, [callback])
 
-Experimental
+**Deprecated**
 
 Read the data from `readableStream` and send it to the `writableStream`.
 When `writableStream.write(data)` returns `false` `readableStream` will be
index c8fb984..d4b1933 100644 (file)
@@ -482,7 +482,7 @@ exports.exec = exports.deprecate(function() {
 }, 'util.exec is now called `child_process.exec`.');
 
 
-exports.pump = function(readStream, writeStream, callback) {
+function pump(readStream, writeStream, callback) {
   var callbackCalled = false;
 
   function call(a, b, c) {
@@ -517,7 +517,9 @@ exports.pump = function(readStream, writeStream, callback) {
     readStream.destroy();
     call(err);
   });
-};
+}
+exports.pump = exports.deprecate(pump,
+    'util.pump() is deprecated. Use ReadableStream.prototype.pump() instead.');
 
 
 /**