From 4bd396a9bfd72dd17b26e91679e6fcc8d627cb1c Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Mon, 1 Sep 2014 22:44:19 +0800 Subject: [PATCH] net: Improve Socket.prototype.write() Reviewed-by: Trevor Norris --- lib/net.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index d28483dd3cc..c2f320d75ad 100644 --- a/lib/net.js +++ b/lib/net.js @@ -606,7 +606,7 @@ Socket.prototype.__defineGetter__('localPort', function() { Socket.prototype.write = function(chunk, encoding, cb) { if (!util.isString(chunk) && !util.isBuffer(chunk)) throw new TypeError('invalid data'); - return stream.Duplex.prototype.write.apply(this, arguments); + return stream.Duplex.prototype.write.call(this, chunk, encoding, cb); };