Repository navigation
Commit 83e2029
authored
Throw on unexpected return types for number TurboModule methods on Android
Summary:
In `JavaTurboModule::invokeJavaMethod`, the `NumberKind` case only handled boxed `Double`/`Float`/`Integer` and primitive `D`/`F`/`I` return types. Any other return type fell through into the `StringKind` case, which called the method as an object-returning method and converted the result as a string. Throw a `std::runtime_error` naming the method and its return type instead, matching how the `default` case reports an unknown method kind.
Changelog: [Android][Fixed] - Throw an error instead of treating the result as a string when a number TurboModule method has an unexpected return type
Differential Revision: D131835371
Pull Request resolved: #600091 parent 8c389bb commit 83e2029
1 file changed
Lines changed: 3 additions & 0 deletions
File tree
- packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
867 | 870 | | |
868 | 871 | | |
869 | 872 | | |
| |||
0 commit comments