Skip to content

Child Process send incorrectly serializes values#5453

@jacobp100

Description

@jacobp100

Code

index.js

const childProcess = require('child_process').fork(__dirname + '/worker.js'); childProcess.send('get-infinity'); childProcess.on('message', (valuePair) =>{console.log(valuePair)}); 

worker.js

process.on('message', () =>{process.send(['Infinity', Infinity]); process.send(['NaN', NaN])}); 

Expected Result

['Infinity', Infinity] ['NaN', NaN] 

Actual Result

['Infinity', null] ['NaN', null] 
  • Version: _output of node -v

v5.6.0

  • Platform: _either uname -a output, or if Windows, version and 32-bit or
    64-bit

Linux tido-tchaikovsky 3.19.0-51-generic #57~14.04.1-Ubuntu SMP Fri Feb 19 14:36:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

  • Subsystem: optional. if known - please specify affected core module name

child_process

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions