Skip to content

Commit

Permalink
dgram: remove unnecessary fd property from Socket
Browse files Browse the repository at this point in the history
It seems the property socket.fd is used long before for the
compatibility reason but it's not used anymore. It's also
not documented in docs so that it's not a public api/property.
Keep the property also make the code a bit confusing as
socket._handle.fd is the actual property representing fd.

PR-URL: #21684
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
  • Loading branch information
oyyd authored and maclover7 committed Aug 10, 2018
1 parent 7b1f3a4 commit 3ce6bc3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function Socket(type, listener) {

this[async_id_symbol] = handle.getAsyncId();
this.type = type;
this.fd = null; // compatibility hack

if (typeof listener === 'function')
this.on('message', listener);
Expand Down Expand Up @@ -116,7 +115,6 @@ function startListening(socket) {
state.handle.recvStart();
state.receiving = true;
state.bindState = BIND_STATE_BOUND;
socket.fd = -42; // compatibility hack

if (state.recvBufferSize)
bufferSize(socket, state.recvBufferSize, RECV_BUFFER);
Expand Down Expand Up @@ -677,7 +675,6 @@ function stopReceiving(socket) {

state.handle.recvStop();
state.receiving = false;
socket.fd = null; // compatibility hack
}


Expand Down

0 comments on commit 3ce6bc3

Please sign in to comment.