Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! net: refactor to use more primordials
This reverts commit a9fe755.
  • Loading branch information
aduh95 committed Nov 28, 2020
commit 7a938d640db024e1c0efb532ac6516cc786ffb9d
8 changes: 4 additions & 4 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function Socket(options) {
options.autoDestroy = true;
// Handle strings directly.
options.decodeStrings = false;
ReflectApply(stream.Duplex, this, arguments);
ReflectApply(stream.Duplex, this, [options]);

if (options.handle) {
this._handle = options.handle; // private
Expand Down Expand Up @@ -442,7 +442,7 @@ function afterShutdown() {
function writeAfterFIN(chunk, encoding, cb) {
if (!this.writableEnded) {
return ReflectApply(
stream.Duplex.prototype.write, this, arguments);
stream.Duplex.prototype.write, this, [chunk, encoding, cb]);
}

if (typeof encoding === 'function') {
Expand Down Expand Up @@ -586,7 +586,7 @@ Socket.prototype._read = function(n) {


Socket.prototype.end = function(data, encoding, callback) {
ReflectApply(stream.Duplex.prototype.end, this, arguments);
ReflectApply(stream.Duplex.prototype.end, this, [data, encoding, callback]);
DTRACE_NET_STREAM_END(this);
return this;
};
Expand Down Expand Up @@ -620,7 +620,7 @@ Socket.prototype.read = function(n) {
!this._handle.reading) {
tryReadStart(this);
}
return ReflectApply(stream.Duplex.prototype.read, this, arguments);
return ReflectApply(stream.Duplex.prototype.read, this, [n]);
};


Expand Down