net: Improve Socket.prototype.write()
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
parent
a054f8eb29
commit
4bd396a9bf
@ -606,7 +606,7 @@ Socket.prototype.__defineGetter__('localPort', function() {
|
|||||||
Socket.prototype.write = function(chunk, encoding, cb) {
|
Socket.prototype.write = function(chunk, encoding, cb) {
|
||||||
if (!util.isString(chunk) && !util.isBuffer(chunk))
|
if (!util.isString(chunk) && !util.isBuffer(chunk))
|
||||||
throw new TypeError('invalid data');
|
throw new TypeError('invalid data');
|
||||||
return stream.Duplex.prototype.write.apply(this, arguments);
|
return stream.Duplex.prototype.write.call(this, chunk, encoding, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user