Skip to content

Commit 7ef278a

Browse files
RSNarafacebook-github-bot
authored andcommitted
RuntimeExecutor: Remove noexcept from sync ui thread utils (#51514)
Summary: Pull Request resolved: #51514 This util can execute arbitrary runtimeWork, which can throw. In the future, we'll also make these utils execute ui blocks posted from the javascript thread. And those will be able to throw. Therefore, let's remove the noexcept. Otherwise, if an exception bubbles up to this util, it will just crash this app. Changelog: [General][Changed] - RuntimeExecutor: Remove noexcept from sync ui thread utils Reviewed By: javache Differential Revision: D75183993 fbshipit-source-id: 6c3a319fe3a76165a265815e6343220cf9db6fde
1 parent 4974839 commit 7ef278a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ using RuntimeExecutor =
4343
*/
4444
inline static void executeSynchronouslyOnSameThread_CAN_DEADLOCK(
4545
const RuntimeExecutor& runtimeExecutor,
46-
std::function<void(jsi::Runtime&)>&& runtimeWork) noexcept {
46+
std::function<void(jsi::Runtime&)>&& runtimeWork) {
4747
std::promise<jsi::Runtime*> runtime;
4848
std::promise<void> runtimeCaptureBlockDone;
4949
std::promise<void> runtimeWorkDone;
@@ -75,7 +75,7 @@ inline static void executeSynchronouslyOnSameThread_CAN_DEADLOCK(
7575
template <typename DataT>
7676
inline static DataT executeSynchronouslyOnSameThread_CAN_DEADLOCK(
7777
const RuntimeExecutor& runtimeExecutor,
78-
std::function<DataT(jsi::Runtime& runtime)>&& runtimeWork) noexcept {
78+
std::function<DataT(jsi::Runtime& runtime)>&& runtimeWork) {
7979
DataT data;
8080

8181
executeSynchronouslyOnSameThread_CAN_DEADLOCK(

0 commit comments

Comments
 (0)