Commit 78ca61e2 authored by Denys Otrishko's avatar Denys Otrishko Committed by Rich Trott
Browse files

net: check args in net.connect() and socket.connect() calls

Previously Node.js would handle empty `net.connect()` and
`socket.connect()` call as if the user passed empty options object which
doesn't really make sense. This was due to the fact that it uses the
same `normalizeArgs` function as `.listen()` call where such call is
perfectly fine.

This will make it clear what is the problem with such call and how it
can be resolved. It now throws `ERR_MISSING_ARGS` if no arguments were
passed or neither `path` nor `port` is specified.

Fixes: https://github.com/nodejs/node/issues/33930

PR-URL: https://github.com/nodejs/node/pull/34022


Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarZeyu Yang <himself65@outlook.com>
parent b546a2b4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment