-
Notifications
You must be signed in to change notification settings - Fork 30k
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
dns: lookupService() callback must be a function #8170
Conversation
lookupService() requires a callback function. This commit adds a check to verify that the callback is actually a function.
makeAsync() is an internal method in the dns module. All of the functions that call makeAsync() have already validated that the callback is a function. This commit removes a redundant typeof function check.
Hmmmm.... my knee jerk reaction is semver-major but you're right, it didn't work previously if a function wasn't passed.... I think that's enough to label this a semver-patch. |
The change itself LGTM |
LGTM |
LGTM and CI: https://ci.nodejs.org/job/node-test-pull-request/3751 :-) |
CI again because Jenkins: https://ci.nodejs.org/job/node-test-pull-request/3767/ |
lookupService() requires a callback function. This commit adds a check to verify that the callback is actually a function. PR-URL: #8170 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
makeAsync() is an internal method in the dns module. All of the functions that call makeAsync() have already validated that the callback is a function. This commit removes a redundant typeof function check. PR-URL: #8170 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Landed in 3a43568 and 013d76c. |
lookupService() requires a callback function. This commit adds a check to verify that the callback is actually a function. PR-URL: #8170 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
makeAsync() is an internal method in the dns module. All of the functions that call makeAsync() have already validated that the callback is a function. This commit removes a redundant typeof function check. PR-URL: #8170 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
dns
Description of change
lookupService()
requires a callback function. The first commit in this PR adds a check to verify that the callback is actually a function.As a result of the first commit, the second commit drops a pointless check.
makeAsync()
is an internal method in the dns module. All of the functions that callmakeAsync()
have already validated that the callback is a function. The second commit removes a redundanttypeof
function check.lookupService()
already does not work unless a function is passed, but technically the change in error message makes this a semver major. It is worth noting that currently, if you pass an object as the callback,lookupService()
does not throw immediately, and instead throws in an asynchronous callback. Perhaps that is enough to convince someone that this is a bug fix and not just a semver major error message change ;-)