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: validate integer values in Deno.exitCode setter #24068

Merged
merged 6 commits into from
Jun 3, 2024

Conversation

petamoriken
Copy link
Contributor

@petamoriken petamoriken commented Jun 1, 2024

related: #23609

This PR includes the following:

  • Delete the non-executed cli/tests/unit/os_test.ts and move its tests to tests/unit/os_test.ts
  • Fix to validate integer values in Deno.exitCode setter (no implicit type conversions)
  • Fix to match process.exitCode to Node.js behavior (my env: v22.2.0, M1 Mac)

Comment on lines -105 to -106
const code = NumberParseInt(value, 10);
if (typeof code !== "number") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the code variable is always a number, this validation was dead code.

@petamoriken petamoriken marked this pull request as draft June 1, 2024 12:11
@petamoriken petamoriken marked this pull request as ready for review June 1, 2024 13:26
@petamoriken
Copy link
Contributor Author

@dsherret @bartlomieju please take a look!

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for improving this API!

@bartlomieju
Copy link
Member

I guess we're blocked by WPT update?

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

Thanks!

@dsherret dsherret merged commit eda43c4 into denoland:main Jun 3, 2024
17 checks passed
@petamoriken petamoriken deleted the fix/exit-code-tests branch June 3, 2024 01:33
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.

3 participants