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: handle net.connect() without arguments #34022

Closed
wants to merge 2 commits into from

Commits on Jun 23, 2020

  1. lib: handle one of args case in ERR_MISSING_ARGS

    This makes ERR_MISSING_ARGS handle nested arrays in argument names as
    one-of case and will print them as '"arg1" or "arg2" or "arg3"'.
    
    Example:
    ```js
    throw new ERR_MISSING_ARGS(['a', 'b', 'c']);
    // will result in message:
    // The "a" or "b" or "c" argument must be specified
    ```
    lundibundi committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    12115eb View commit details
    Browse the repository at this point in the history
  2. 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: nodejs#33930
    lundibundi committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    6711ed5 View commit details
    Browse the repository at this point in the history