From 3ce6bc3b5082478dfe6832997640c93de97705be Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Fri, 10 Aug 2018 10:51:24 +0800 Subject: [PATCH] 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: /~https://github.com/nodejs/node/pull/21684 Reviewed-By: Anna Henningsen Reviewed-By: Minwoo Jung Reviewed-By: Matteo Collina Reviewed-By: Colin Ihrig Reviewed-By: Jon Moss --- lib/dgram.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/dgram.js b/lib/dgram.js index 44a7f09d006104..af1e23f512d5d7 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -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); @@ -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); @@ -677,7 +675,6 @@ function stopReceiving(socket) { state.handle.recvStop(); state.receiving = false; - socket.fd = null; // compatibility hack }