Skip to content
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

net: use missing validator #38984

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const {
const { isUint8Array } = require('internal/util/types');
const {
validateAbortSignal,
validateFunction,
validateInt32,
validateNumber,
validatePort,
Expand Down Expand Up @@ -1002,10 +1003,8 @@ function lookupAndConnect(self, options) {
return;
}

if (options.lookup && typeof options.lookup !== 'function')
throw new ERR_INVALID_ARG_TYPE('options.lookup',
'Function', options.lookup);

if (options.lookup !== undefined)
validateFunction(options.lookup, 'options.lookup');

if (dns === undefined) dns = require('dns');
const dnsopts = {
Expand Down