From e605cabca8d2c8a554e7480ea043d5482e34761d Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Fri, 25 Apr 2025 00:44:20 -0700 Subject: [PATCH] changes --- src/js/node/net.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/node/net.ts b/src/js/node/net.ts index 6d4f925698..eb55ae7259 100644 --- a/src/js/node/net.ts +++ b/src/js/node/net.ts @@ -1422,6 +1422,10 @@ Server.prototype.listen = function listen(...args) { hostname = path; } + if (args.length > 1 && normalized.port === undefined && path === undefined) { + throw $ERR_INVALID_ARG_VALUE("options", normalized, "is invalid"); + } + if (port < 0 || Number.isNaN(port) || !Number.isSafeInteger(port) || port > 65535) { throw $ERR_SOCKET_BAD_PORT("port must be a non-negative integer between 0 and 65535"); }