refactor: merge std::runtime_error catch blocks in host functions - #1109
Merged
Conversation
The separate std::runtime_error catches were a workaround for broken RTTI in older React Native versions. The fix from react/react-native@3132cc8 is present in RN 0.81+, which is the project's minimum supported version, so std::runtime_error can now be caught polymorphically via std::exception. Closes #964
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
std::runtime_error(andjsi::JSError) catch blocks acrossModelHostObject.handRnExecutorchInstaller.h. They were workarounds for broken RTTI in older RN versions; the fix from react/react-native@3132cc8 is present in RN 0.81+, which is the project's minimum supported version.std::exceptionpolymorphically:synchronousHostFunction,visionHostFunction,promiseHostFunction,unload, and the model loader inRnExecutorchInstaller.Closes #964
Test plan
common/rnexecutorch/testspass on Android (run_tests.sh)