From 929846b2b0ecc1e50ead53d82b3d9f6cc6499fb2 Mon Sep 17 00:00:00 2001 From: Wyatt Preul Date: Mon, 24 Aug 2015 16:53:46 -0500 Subject: [PATCH] util: remove pump --- doc/api/util.markdown | 8 +------- lib/repl.js | 2 +- lib/util.js | 38 -------------------------------------- 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/doc/api/util.markdown b/doc/api/util.markdown index b1ab10a81e094f..96a4a5fc7c0498 100644 --- a/doc/api/util.markdown +++ b/doc/api/util.markdown @@ -260,7 +260,7 @@ Returns `true` if the given "object" is a `Boolean`. `false` otherwise. // false util.isBoolean(false) // true - + ## util.isBuffer(object) Stability: 0 - Deprecated @@ -493,12 +493,6 @@ Output with timestamp on `stdout`. Deprecated predecessor of `console.log`. -## util.pump(readableStream, writableStream[, callback]) - - Stability: 0 - Deprecated: Use readableStream.pipe(writableStream) - -Deprecated predecessor of `stream.pipe()`. - ## util.puts([...]) Stability: 0 - Deprecated: Use console.log() instead. diff --git a/lib/repl.js b/lib/repl.js index 87014b5d5d2a90..4485b4016b1363 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -611,7 +611,7 @@ function filteredOwnPropertyNames(obj) { // // Example: // complete('var foo = util.') -// -> [['util.print', 'util.debug', 'util.log', 'util.inspect', 'util.pump'], +// -> [['util.print', 'util.debug', 'util.log', 'util.inspect'], // 'util.' ] // // Warning: This eval's code like "foo.bar.baz", so it will run property diff --git a/lib/util.js b/lib/util.js index eeeb42a9489821..0666300d68e809 100644 --- a/lib/util.js +++ b/lib/util.js @@ -864,44 +864,6 @@ exports.error = internalUtil.deprecate(function(x) { }, 'util.error is deprecated. Use console.error instead.'); -exports.pump = internalUtil.deprecate(function(readStream, writeStream, cb) { - var callbackCalled = false; - - function call(a, b, c) { - if (cb && !callbackCalled) { - cb(a, b, c); - callbackCalled = true; - } - } - - readStream.addListener('data', function(chunk) { - if (writeStream.write(chunk) === false) readStream.pause(); - }); - - writeStream.addListener('drain', function() { - readStream.resume(); - }); - - readStream.addListener('end', function() { - writeStream.end(); - }); - - readStream.addListener('close', function() { - call(); - }); - - readStream.addListener('error', function(err) { - writeStream.end(); - call(err); - }); - - writeStream.addListener('error', function(err) { - readStream.destroy(); - call(err); - }); -}, 'util.pump is deprecated. Use readableStream.pipe instead.'); - - exports._errnoException = function(err, syscall, original) { var errname = uv.errname(err); var message = syscall + ' ' + errname;