Skip to content

Commit 007cfea

Browse files
geekjasnell
authored andcommitted
util: remove pump
Remove util.pump and associated tests PR-URL: #2531 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a2c0aa8 commit 007cfea

File tree

5 files changed

+1
-130
lines changed

5 files changed

+1
-130
lines changed

doc/api/util.markdown

-6
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,6 @@ Output with timestamp on `stdout`.
493493

494494
Deprecated predecessor of `console.log`.
495495

496-
## util.pump(readableStream, writableStream[, callback])
497-
498-
Stability: 0 - Deprecated: Use readableStream.pipe(writableStream)
499-
500-
Deprecated predecessor of `stream.pipe()`.
501-
502496
## util.puts([...])
503497

504498
Stability: 0 - Deprecated: Use console.log() instead.

lib/repl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ function filteredOwnPropertyNames(obj) {
611611
//
612612
// Example:
613613
// complete('var foo = util.')
614-
// -> [['util.print', 'util.debug', 'util.log', 'util.inspect', 'util.pump'],
614+
// -> [['util.print', 'util.debug', 'util.log', 'util.inspect'],
615615
// 'util.' ]
616616
//
617617
// Warning: This eval's code like "foo.bar.baz", so it will run property

lib/util.js

-38
Original file line numberDiff line numberDiff line change
@@ -864,44 +864,6 @@ exports.error = internalUtil.deprecate(function(x) {
864864
}, 'util.error is deprecated. Use console.error instead.');
865865

866866

867-
exports.pump = internalUtil.deprecate(function(readStream, writeStream, cb) {
868-
var callbackCalled = false;
869-
870-
function call(a, b, c) {
871-
if (cb && !callbackCalled) {
872-
cb(a, b, c);
873-
callbackCalled = true;
874-
}
875-
}
876-
877-
readStream.addListener('data', function(chunk) {
878-
if (writeStream.write(chunk) === false) readStream.pause();
879-
});
880-
881-
writeStream.addListener('drain', function() {
882-
readStream.resume();
883-
});
884-
885-
readStream.addListener('end', function() {
886-
writeStream.end();
887-
});
888-
889-
readStream.addListener('close', function() {
890-
call();
891-
});
892-
893-
readStream.addListener('error', function(err) {
894-
writeStream.end();
895-
call(err);
896-
});
897-
898-
writeStream.addListener('error', function(err) {
899-
readStream.destroy();
900-
call(err);
901-
});
902-
}, 'util.pump is deprecated. Use readableStream.pipe instead.');
903-
904-
905867
exports._errnoException = function(err, syscall, original) {
906868
var errname = uv.errname(err);
907869
var message = syscall + ' ' + errname;

test/sequential/test-pump-file2tcp-noexist.js

-47
This file was deleted.

test/sequential/test-pump-file2tcp.js

-38
This file was deleted.

0 commit comments

Comments
 (0)