-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dgram: remove unnecessary fd property from Socket #21684
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory this LGTM as a semver-major, but it might need a CITGM run.
lib/dgram.js
Outdated
@@ -138,7 +138,6 @@ function Socket(type, listener) { | |||
this._bindState = BIND_STATE_UNBOUND; | |||
this[async_id_symbol] = this._handle.getAsyncId(); | |||
this.type = type; | |||
this.fd = null; // compatibility hack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... @nodejs/tsc ... do we know if this could break anyone? It may be minor, but we should likely do a deprecation on this before just removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a simple semver-major removal is fine for this, given that it seems pretty unusable.
This needs another @nodejs/tsc review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I guess I didn't make my LGTM explicit enough before.
@oyyd Can you rebase this PR please? |
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.
b0c3494
to
4fa3fbd
Compare
@maclover7 PTAL |
CI is green besides for worker tests which are having infra issues right now, this should be safe to land |
Landed in 3ce6bc3 |
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>
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 makes the code a bit confusing as
socket._handle.fd
is the actual property representing fd.make -j4 test
(UNIX), orvcbuild test
(Windows) passes