Repository navigation
Make the conversions of parseInt and isNaN explicit - #2168
SamChou19815 wants to merge 1 commit into
Conversation
Summary: X-link: react/react-native#59799 TypeScript declares `parseInt(string: string, radix?: number)` and `isNaN(number: number)`, and Flow is adopting the same signatures. Calls that pass another type rely on the function's implicit conversion and start to error. Wrap each such argument in `String(...)` (`parseInt`) or `Number(...)` (`isNaN`), the conversion the function already applies, so behavior doesn't change. The calls were found from Flow's errors and rewritten by a codemod. 8 arguments in 6 files in React Native and Metro. Changelog: [Internal] Differential Revision: D129644365
|
@SamChou19815 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D129644365. |
Metro review: Looks goodRisk: low · Commit: This PR wraps the two No findings. Verified
Not run: No differential ran for the unchanged-behavior claim: the command for a script comparing Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
Summary:
X-link: react/react-native#59799
TypeScript declares
parseInt(string: string, radix?: number)andisNaN(number: number), and Flow is adopting the same signatures. Calls that pass another type rely on the function's implicit conversion and start to error.Wrap each such argument in
String(...)(parseInt) orNumber(...)(isNaN), the conversion the function already applies, so behavior doesn't change. The calls were found from Flow's errors and rewritten by a codemod. 8 arguments in 6 files in React Native and Metro.Changelog: [Internal]
Differential Revision: D129644365