Skip to content

Commit 5f92d2f

Browse files
VoltrexKeyvadanielleadams
authored andcommitted
dgram: use simplified validator
The `dgram` lib module should use the simplified `validatePort()` validator. PR-URL: #39753 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Zijian Liu <[email protected]>
1 parent 5afdc1f commit 5f92d2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/dgram.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
369369
};
370370

371371
Socket.prototype.connect = function(port, address, callback) {
372-
port = validatePort(port, 'Port', { allowZero: false });
372+
port = validatePort(port, 'Port', false);
373373
if (typeof address === 'function') {
374374
callback = address;
375375
address = '';
@@ -626,7 +626,7 @@ Socket.prototype.send = function(buffer,
626626
}
627627

628628
if (!connected)
629-
port = validatePort(port, 'Port', { allowZero: false });
629+
port = validatePort(port, 'Port', false);
630630

631631
// Normalize callback so it's either a function or undefined but not anything
632632
// else.

0 commit comments

Comments
 (0)