From 6918fff9c91efb6b3fb7a4b4b9ac928d63d9b89b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 13 Dec 2017 07:39:29 +0100 Subject: net: remove Socket.prototype.write This is superfluous now that typechecking in `net` and `stream` are aligned. PR-URL: https://github.com/nodejs/node/pull/17644 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anatoli Papirovski Reviewed-By: James M Snell Reviewed-By: Jon Moss --- lib/net.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/net.js b/lib/net.js index f962a848fa..5562db6ed6 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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 -- cgit v1.2.3