From 3219616f43d4512932f85106f02fe697fdc57051 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 5 Aug 2012 23:31:28 +0200 Subject: [PATCH] util: mark util.pump() as deprecated --- doc/api/util.markdown | 2 +- lib/util.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api/util.markdown b/doc/api/util.markdown index 8b16cad531..165cdf34fa 100644 --- a/doc/api/util.markdown +++ b/doc/api/util.markdown @@ -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 diff --git a/lib/util.js b/lib/util.js index c8fb98436b..d4b19334b2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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.'); /**