Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
net: remove Socket.prototype.write
This is superfluous now that typechecking in `net` and
`stream` are aligned.
  • Loading branch information
addaleax committed Dec 13, 2017
commit 1a7918ca9ec42fd0be63f05b1ffe446a8a7794c7
11 changes: 0 additions & 11 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,17 +701,6 @@ protoGetter('localPort', function localPort() {
});


Socket.prototype.write = function(chunk, encoding, cb) {
if (typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
throw new errors.TypeError('ERR_INVALID_ARG_TYPE',
'chunk',
['string', 'Buffer'],
chunk);
}
return stream.Duplex.prototype.write.apply(this, arguments);
};


Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
// If we are still connecting, then buffer this for later.
// The Writable logic will buffer up any more writes while
Expand Down