Skip to content
Permalink
Browse files

util: remove pump

Remove util.pump and associated tests

PR-URL: #2531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
geek authored and jasnell committed Aug 24, 2015
1 parent a2c0aa8 commit 007cfea30829ec10a9ba690dd8f28d7afe1462a7
Showing with 1 addition and 130 deletions.
  1. +0 −6 doc/api/util.markdown
  2. +1 −1 lib/repl.js
  3. +0 −38 lib/util.js
  4. +0 −47 test/sequential/test-pump-file2tcp-noexist.js
  5. +0 −38 test/sequential/test-pump-file2tcp.js
@@ -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.
@@ -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
@@ -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;

This file was deleted.

This file was deleted.

0 comments on commit 007cfea

Please sign in to comment.
You can’t perform that action at this time.