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

fix: support uint8 exit code range #6303

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

liz3
Copy link
Contributor

@liz3 liz3 commented Oct 4, 2023

The exit code support is between 0-255 and not only in the signed positive range (0-127).
Node.js does not seam to throw on a bigger integer and just wraps around, but throwing a error is a good approach and makes the behaviour more defined.

This allows the range to be 0-255.

Fixes: #6284

What does this PR do?

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

  • I included a test for the new code, or an existing test covers it

The exit code support is between 0-255 and not only in the signed positive range
(0-127).
Node.js does not seam to throw on a bigger integer and just wraps around,
but throwing a error is a good approach and makes the behaviour more defined.

This allows the range to be 0-255

Fixes: oven-sh#6284
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@paperdave
Copy link
Member

i remember discovering the wrap around behavior when doing process.exit, i hope no one actually relies on it. i think it's fine to throw here, but technically we should be wrapping.

@liz3
Copy link
Contributor Author

liz3 commented Oct 7, 2023

can this be merged?

@Electroid Electroid merged commit a9e1792 into oven-sh:main Oct 9, 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

Successfully merging this pull request may close these issues.

process.exitCode setter not aligned with Node.js
4 participants