From 7ef278af505deba6b8a47876c6824f9a7fefa427 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 27 May 2025 12:21:04 -0700 Subject: [PATCH] RuntimeExecutor: Remove noexcept from sync ui thread utils (#51514) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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 --- .../ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h b/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h index 0062af95f8e..41ec520599f 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +++ b/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h @@ -43,7 +43,7 @@ using RuntimeExecutor = */ inline static void executeSynchronouslyOnSameThread_CAN_DEADLOCK( const RuntimeExecutor& runtimeExecutor, - std::function&& runtimeWork) noexcept { + std::function&& runtimeWork) { std::promise runtime; std::promise runtimeCaptureBlockDone; std::promise runtimeWorkDone; @@ -75,7 +75,7 @@ inline static void executeSynchronouslyOnSameThread_CAN_DEADLOCK( template inline static DataT executeSynchronouslyOnSameThread_CAN_DEADLOCK( const RuntimeExecutor& runtimeExecutor, - std::function&& runtimeWork) noexcept { + std::function&& runtimeWork) { DataT data; executeSynchronouslyOnSameThread_CAN_DEADLOCK(