mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
179b684e76
Summary: Changelog: [General][Fixed] Fixed crash when passing fewer arguments than expected in native modules using codegen ## Context Right now, if you have a native module using the codegen with a method like this: ``` someMethod(value: number): void; ``` And you call it like this: ``` NativeModule.someMethod(); ``` The app crashes. This happens because the codegen tries to cast the value to the expected type without checking if the argument is within the bounds of the arguments array. ## Changes This fixes that issue with a change in the codegen to guard against this in the generated code (see changes in the snapshot tests). Reviewed By: RSNara Differential Revision: D54206287 fbshipit-source-id: 575af462725515928f8634fccc7a9cb51ca0ce4f