mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
Fix typo in dangerfile.js which results in an unreachable code path… (#32277)
## 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:221f3002ca/dangerfile.js (L73)Compare:221f3002ca/dangerfile.js (L171)And the case which should hit this code path:221f3002ca/dangerfile.js (L160)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](https://github.com/facebook/react/issues/32278)
This commit is contained in:
parent
221f3002ca
commit
87c03a0a13
|
|
@ -70,7 +70,7 @@ const percentFormatter = new Intl.NumberFormat('en', {
|
|||
});
|
||||
|
||||
function change(decimal) {
|
||||
if (Number === Infinity) {
|
||||
if (decimal === Infinity) {
|
||||
return 'New file';
|
||||
}
|
||||
if (decimal === -1) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user