Skip to content

unexpected breaking changes with process.exitCode/process.exit() #45683

Open
@nlf

Description

@nlf

Version

20.0.0-pre (nightly)

Platform

Darwin dib.lan 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64

Subsystem

process

What steps will reproduce the bug?

const assert = require('assert')

process.exitCode = 2
delete process.exitCode // REMOVE
assert(process.exitCode === undefined) // REMOVE
process.exit(undefined)

How often does it reproduce? Is there a required condition?

reproduces on all node versions built after landing #44711

What is the expected behavior?

the assertion should pass, and if the two lines marked REMOVE are commented out the process should exit with code 2

What do you see instead?

the assertion throws, and if the two lines marked REMOVE are commented out the process exits with code 0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions