Skip to content

Commit

Permalink
net: remove Socket.prototype.write
Browse files Browse the repository at this point in the history
This is superfluous now that typechecking in `net` and
`stream` are aligned.

PR-URL: #17644
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
  • Loading branch information
addaleax authored and MylesBorins committed Jan 9, 2018
1 parent 757e685 commit c3810e2
Showing 1 changed file with 0 additions and 11 deletions.
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

0 comments on commit c3810e2

Please sign in to comment.