Skip to content

Commit d008e96

Browse files
Fix 'isFinite' polyfill resulting in infinite recursion (#2143)
1 parent 37cbb6a commit d008e96

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/polyfills/isFinite.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// @flow strict
22

3-
declare function isFinite(value: mixed): boolean %checks(typeof value ===
4-
'number');
3+
declare function isFinitePolyfill(
4+
value: mixed,
5+
): boolean %checks(typeof value === 'number');
56

67
/* eslint-disable no-redeclare */
78
// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441
8-
const isFinite =
9+
const isFinitePolyfill =
910
Number.isFinite ||
1011
function(value) {
1112
return typeof value === 'number' && isFinite(value);
1213
};
13-
export default isFinite;
14+
export default isFinitePolyfill;

0 commit comments

Comments
 (0)