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

process.exit changes of behavior since v20 with an undefined parameter #48027

Closed
srapilly opened this issue May 16, 2023 · 4 comments
Closed

Comments

@srapilly
Copy link

Version

v20.1.0

Platform

21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

Hi,

Before the v20, process.exit(undefined) had the same behavior than process.exit() without parameter

The listener callback function is invoked with the exit code specified either by the process.exitCode property, or the exitCode argument passed to the process.exit() method.

PR that made the changes: https://github.com/nodejs/node/pull/43716/files#diff-38d3873e06750436cd724af3eb60026b1bb8da914467797cf7ef7a3c94bd74ceL197-L425

is this intended ? This is causing the following issue with npm npm/cli#6399

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

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

Reproduction file:

process.exitCode = 1

process.exit(undefined)
=> node -v
v20.1.0
=> node ./example.js
=> echo $?
0
=> node -v
v19.9.0
=> node ./example.js
=> echo $?
1

Additional information

No response

@targos
Copy link
Member

targos commented May 16, 2023

@daeyeon @aduh95

@daeyeon
Copy link
Member

daeyeon commented May 16, 2023

Yes, it's intended, and landed as semver-major through a full deprecation cycle. There was a fix for a duplicate issue, but it was not appied as the changed behaviour is correct and more straightforward.

@srapilly
Copy link
Author

Thanks @daeyeon I didn't saw the existing issue on this, my bad :)

@aduh95
Copy link
Contributor

aduh95 commented May 16, 2023

Closing as duplicate of #45688

@aduh95 aduh95 closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants