Skip to content

Commit c3810e2

Browse files
addaleaxMylesBorins
authored andcommitted
net: remove Socket.prototype.write
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]>
1 parent 757e685 commit c3810e2

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/net.js

-11
Original file line numberDiff line numberDiff line change
@@ -701,17 +701,6 @@ protoGetter('localPort', function localPort() {
701701
});
702702

703703

704-
Socket.prototype.write = function(chunk, encoding, cb) {
705-
if (typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
706-
throw new errors.TypeError('ERR_INVALID_ARG_TYPE',
707-
'chunk',
708-
['string', 'Buffer'],
709-
chunk);
710-
}
711-
return stream.Duplex.prototype.write.apply(this, arguments);
712-
};
713-
714-
715704
Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
716705
// If we are still connecting, then buffer this for later.
717706
// The Writable logic will buffer up any more writes while

0 commit comments

Comments
 (0)