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 typo in dangerfile.js which results in an unreachable code path… #32277

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

davegregg
Copy link
Contributor

@davegregg davegregg commented Jan 31, 2025

Summary

Fix typo in dangerfile.js which results in an unreachable code path which ought to be hit when there is no matching base artifact during DangerCI automated code review.

See:

if (Number === Infinity) {

Compare:
change: Infinity,

And the case which should hit this code path:
// There's no matching base artifact. This is a new file.

Given the above context, the condition Number === Infinity is clearly meant to be decimal === Infinity, which it will be if the catch statement triggers when there is no matching base artifact. Without this fix, the primitive value Infinity is passed to percentFormatter.format(decimal), resulting in the string '+∞%'. With this fix, the resulting string will be the intended 'New file'.

Resolves issue 32278

…hich ought to be hit when there is no matching base artifact.
@poteto
Copy link
Member

poteto commented Jan 31, 2025

thanks!

@poteto poteto merged commit 87c03a0 into facebook:main Jan 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants