GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fork method, args parameter cannot be null · Issue #22154 · nodejs/node

fork method, args parameter cannot be null #22154

New issue
Copy link
New issue
Copy link
Closed
Closed
fork method, args parameter cannot be null#22154
Copy link
Labels
child_processIssues and PRs related to the child_process subsystem.docIssues and PRs related to Node.js documentation.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.

Description

@wallet77
wallet77
opened on Aug 6, 2018
Issue body actions
  • Version: 10.5.0 (but I think this is not related)
  • Platform: Ubuntu 18.04.1 LTS (but I think this is not related)
  • Subsystem: child_process

Hi,

I've just realized that this code can't work because args parameter can't be null. But it's not documented and I think it can be disturbing.

childProcess.fork(app.js', null, {
    execPath: process.execPath
  })

But the following will work :

childProcess.fork(app.js', [], {
    execPath: process.execPath
  })

I think this line is related to the issue :

node/lib/child_process.js

Line 71 in 2bea9ce

if (pos < arguments.length && arguments[pos] != null) {

I'm not sure if it's the intended behavior, or if it's a lack in the documentation ?

Activity

  1. vsemozhetbyt
    added
    child_processIssues and PRs related to the child_process subsystem.
    docIssues and PRs related to Node.js documentation.
    on Aug 6, 2018
  2. fesebuv commented on Aug 7, 2018

    @fesebuv
    fesebuv
    on Aug 7, 2018
    More actions

    That seems to be the intended behavior, since arguments[pos] != null. So it seems we are expecting at least one argument that is not a null.

  3. ZYSzys commented on Dec 24, 2018

    @ZYSzys
    ZYSzys
    on Dec 24, 2018
    Member
    More actions

    It seems that the document has said the args parameter should be an Array of string:

    args {string[]} List of string arguments.

  4. jasnell
    added
    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.
    on Jun 26, 2020
  5. jasnell commented on Jul 6, 2020

    @jasnell
    jasnell
    on Jul 6, 2020
    Member
    More actions

    Testing locally, passing null appears to work as expected. It's likely this was fixed along the way somewhere. Closing but we can reopen if it turns out that there is still something left to do

  6. jasnell
    closed this as completedon Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.docIssues and PRs related to Node.js documentation.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.