Skip to content

Commit 3ce6bc3

Browse files
oyydmaclover7
authored andcommitted
dgram: remove unnecessary fd property from Socket
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>
1 parent 7b1f3a4 commit 3ce6bc3

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/dgram.js

-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ function Socket(type, listener) {
8585

8686
this[async_id_symbol] = handle.getAsyncId();
8787
this.type = type;
88-
this.fd = null; // compatibility hack
8988

9089
if (typeof listener === 'function')
9190
this.on('message', listener);
@@ -116,7 +115,6 @@ function startListening(socket) {
116115
state.handle.recvStart();
117116
state.receiving = true;
118117
state.bindState = BIND_STATE_BOUND;
119-
socket.fd = -42; // compatibility hack
120118

121119
if (state.recvBufferSize)
122120
bufferSize(socket, state.recvBufferSize, RECV_BUFFER);
@@ -677,7 +675,6 @@ function stopReceiving(socket) {
677675

678676
state.handle.recvStop();
679677
state.receiving = false;
680-
socket.fd = null; // compatibility hack
681678
}
682679

683680

0 commit comments

Comments
 (0)