From 44f5989c3bc961a774ffeca593e734e31c327a2c Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 10 Oct 2023 06:57:39 -0700 Subject: [PATCH] Mark AsyncCallback as noexcept (#40745) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/40745 Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D49886196 fbshipit-source-id: 6b4fa888f6cffbf7863167396d13c4a00bf485a2 --- .../jni/react/jni/CatalystInstanceImpl.cpp | 2 +- .../callinvoker/ReactCommon/CallInvoker.h | 10 +++++++--- .../ReactCommon/cxxreact/Instance.cpp | 6 ++++-- .../ReactCommon/cxxreact/Instance.h | 4 ++-- .../ReactCommon/cxxreact/NativeToJsBridge.cpp | 6 +++--- .../ReactCommon/cxxreact/NativeToJsBridge.h | 2 +- .../react/bridging/CallbackWrapper.h | 8 ++++---- .../ReactCommon/react/bridging/Function.h | 19 +++++++++++-------- .../react/bridging/tests/BridgingTest.h | 2 +- .../ios/ReactCommon/RCTTurboModuleManager.mm | 2 +- .../runtimescheduler/RuntimeScheduler.cpp | 10 +++++----- .../runtimescheduler/RuntimeScheduler.h | 10 +++++----- .../RuntimeSchedulerCallInvoker.cpp | 4 ++-- .../RuntimeSchedulerCallInvoker.h | 5 +++-- .../runtimescheduler/SchedulerPriorityUtils.h | 2 +- .../react/renderer/runtimescheduler/Task.cpp | 4 ++-- .../react/renderer/runtimescheduler/Task.h | 4 ++-- .../react/runtime/BridgelessJSCallInvoker.cpp | 3 ++- .../react/runtime/BridgelessJSCallInvoker.h | 2 +- .../BridgelessNativeMethodCallInvoker.cpp | 2 +- .../BridgelessNativeMethodCallInvoker.h | 5 +++-- 21 files changed, 62 insertions(+), 50 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index dd837d50dff5e8..374e1c09c55025 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -362,7 +362,7 @@ CatalystInstanceImpl::getNativeMethodCallInvokerHolder() { : messageQueueThread_(messageQueueThread) {} void invokeAsync( const std::string& methodName, - std::function&& work) override { + std::function&& work) noexcept override { messageQueueThread_->runOnQueue(std::move(work)); } void invokeSync( diff --git a/packages/react-native/ReactCommon/callinvoker/ReactCommon/CallInvoker.h b/packages/react-native/ReactCommon/callinvoker/ReactCommon/CallInvoker.h index d67e82715b7b3d..85d9aa8bc4812b 100644 --- a/packages/react-native/ReactCommon/callinvoker/ReactCommon/CallInvoker.h +++ b/packages/react-native/ReactCommon/callinvoker/ReactCommon/CallInvoker.h @@ -22,8 +22,10 @@ using CallFunc = std::function; */ class CallInvoker { public: - virtual void invokeAsync(CallFunc&& func) = 0; - virtual void invokeAsync(SchedulerPriority /*priority*/, CallFunc&& func) { + virtual void invokeAsync(CallFunc&& func) noexcept = 0; + virtual void invokeAsync( + SchedulerPriority /*priority*/, + CallFunc&& func) noexcept { // When call with priority is not implemented, fall back to a regular async // execution invokeAsync(std::move(func)); @@ -34,7 +36,9 @@ class CallInvoker { class NativeMethodCallInvoker { public: - virtual void invokeAsync(const std::string& methodName, CallFunc&& func) = 0; + virtual void invokeAsync( + const std::string& methodName, + CallFunc&& func) noexcept = 0; virtual void invokeSync(const std::string& methodName, CallFunc&& func) = 0; virtual ~NativeMethodCallInvoker() {} }; diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.cpp b/packages/react-native/ReactCommon/cxxreact/Instance.cpp index 73d75c187cfac8..924b44b719e2d3 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.cpp +++ b/packages/react-native/ReactCommon/cxxreact/Instance.cpp @@ -263,7 +263,8 @@ void Instance::JSCallInvoker::invokeSync(std::function&& work) { "Synchronous native -> JS calls are currently not supported."); } -void Instance::JSCallInvoker::invokeAsync(std::function&& work) { +void Instance::JSCallInvoker::invokeAsync( + std::function&& work) noexcept { std::scoped_lock guard(m_mutex); /** @@ -288,7 +289,8 @@ void Instance::JSCallInvoker::invokeAsync(std::function&& work) { scheduleAsync(std::move(work)); } -void Instance::JSCallInvoker::scheduleAsync(std::function&& work) { +void Instance::JSCallInvoker::scheduleAsync( + std::function&& work) noexcept { if (auto strongNativeToJsBridge = m_nativeToJsBridge.lock()) { strongNativeToJsBridge->runOnExecutorQueue( [work = std::move(work)](JSExecutor* executor) { diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.h b/packages/react-native/ReactCommon/cxxreact/Instance.h index db2e0a7a50c9fa..1cc98d9da15513 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.h +++ b/packages/react-native/ReactCommon/cxxreact/Instance.h @@ -158,12 +158,12 @@ class RN_EXPORT Instance { bool m_shouldBuffer = true; std::list> m_workBuffer; - void scheduleAsync(std::function&& work); + void scheduleAsync(std::function&& work) noexcept; public: void setNativeToJsBridgeAndFlushCalls( std::weak_ptr nativeToJsBridge); - void invokeAsync(std::function&& work) override; + void invokeAsync(std::function&& work) noexcept override; void invokeSync(std::function&& work) override; }; diff --git a/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp b/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp index 3cead7c7688e41..5b48900d78911f 100644 --- a/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp +++ b/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp @@ -91,7 +91,7 @@ class JsToNativeBridge : public react::ExecutorDelegate { moduleId, methodId, std::move(args)); } - void recordTurboModuleAsyncMethodCall() { + void recordTurboModuleAsyncMethodCall() noexcept { m_batchHadNativeModuleOrTurboModuleCalls = true; } @@ -288,7 +288,7 @@ void NativeToJsBridge::destroy() { } void NativeToJsBridge::runOnExecutorQueue( - std::function task) { + std::function&& task) noexcept { if (*m_destroyed) { return; } @@ -326,7 +326,7 @@ NativeToJsBridge::getDecoratedNativeMethodCallInvoker( void invokeAsync( const std::string& methodName, - std::function&& func) override { + std::function&& func) noexcept override { if (auto strongJsToNativeBridge = m_jsToNativeBridge.lock()) { strongJsToNativeBridge->recordTurboModuleAsyncMethodCall(); } diff --git a/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.h b/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.h index c2073624b01739..f8f59f596e424d 100644 --- a/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.h +++ b/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.h @@ -97,7 +97,7 @@ class NativeToJsBridge { */ void destroy(); - void runOnExecutorQueue(std::function task); + void runOnExecutorQueue(std::function&& task) noexcept; /** * NativeMethodCallInvoker is used by TurboModules to schedule work on the diff --git a/packages/react-native/ReactCommon/react/bridging/CallbackWrapper.h b/packages/react-native/ReactCommon/react/bridging/CallbackWrapper.h index 9efa29628e38ec..47079709eedfd6 100644 --- a/packages/react-native/ReactCommon/react/bridging/CallbackWrapper.h +++ b/packages/react-native/ReactCommon/react/bridging/CallbackWrapper.h @@ -45,19 +45,19 @@ class CallbackWrapper : public LongLivedObject { allowRelease(); } - jsi::Function& callback() { + jsi::Function& callback() noexcept { return callback_; } - jsi::Runtime& runtime() { + jsi::Runtime& runtime() noexcept { return runtime_; } - CallInvoker& jsInvoker() { + CallInvoker& jsInvoker() noexcept { return *(jsInvoker_); } - std::shared_ptr jsInvokerPtr() { + std::shared_ptr jsInvokerPtr() noexcept { return jsInvoker_; } }; diff --git a/packages/react-native/ReactCommon/react/bridging/Function.h b/packages/react-native/ReactCommon/react/bridging/Function.h index d0aaf1a8d678cf..922f9fca41a23f 100644 --- a/packages/react-native/ReactCommon/react/bridging/Function.h +++ b/packages/react-native/ReactCommon/react/bridging/Function.h @@ -29,26 +29,28 @@ class AsyncCallback { std::move(function), std::move(jsInvoker))) {} - void operator()(Args... args) const { + void operator()(Args... args) const noexcept { call(std::forward(args)...); } - void call(Args... args) const { + void call(Args... args) const noexcept { callWithArgs(std::nullopt, std::forward(args)...); } - void callWithPriority(SchedulerPriority priority, Args... args) const { + void callWithPriority(SchedulerPriority priority, Args... args) + const noexcept { callWithArgs(priority, std::forward(args)...); } - void call( - std::function&& callImpl) const { + void call(std::function&& callImpl) + const noexcept { callWithFunction(std::nullopt, std::move(callImpl)); } void callWithPriority( SchedulerPriority priority, - std::function&& callImpl) const { + std::function&& callImpl) + const noexcept { callWithFunction(priority, std::move(callImpl)); } @@ -58,7 +60,7 @@ class AsyncCallback { std::shared_ptr> callback_; void callWithArgs(std::optional priority, Args... args) - const { + const noexcept { auto wrapper = callback_->wrapper_.lock(); if (wrapper) { auto& jsInvoker = wrapper->jsInvoker(); @@ -78,7 +80,8 @@ class AsyncCallback { void callWithFunction( std::optional priority, - std::function&& callImpl) const { + std::function&& callImpl) + const noexcept { auto wrapper = callback_->wrapper_.lock(); if (wrapper) { auto& jsInvoker = wrapper->jsInvoker(); diff --git a/packages/react-native/ReactCommon/react/bridging/tests/BridgingTest.h b/packages/react-native/ReactCommon/react/bridging/tests/BridgingTest.h index 9cc7c311958d3a..9b60ec82f691ed 100644 --- a/packages/react-native/ReactCommon/react/bridging/tests/BridgingTest.h +++ b/packages/react-native/ReactCommon/react/bridging/tests/BridgingTest.h @@ -17,7 +17,7 @@ namespace facebook::react { class TestCallInvoker : public CallInvoker { public: - void invokeAsync(std::function&& fn) override { + void invokeAsync(std::function&& fn) noexcept override { queue_.push_back(std::move(fn)); } diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm index a0c98c1995140e..b427ca018030ce 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm @@ -112,7 +112,7 @@ bool isCreatingModule() const public: ModuleNativeMethodCallInvoker(dispatch_queue_t methodQueue) : methodQueue_(methodQueue) {} - void invokeAsync(const std::string &methodName, std::function &&work) override + void invokeAsync(const std::string &methodName, std::function &&work) noexcept override { if (methodQueue_ == RCTJSThread) { work(); diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp index bd611aee1a0852..8aeb9f9826721b 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp @@ -21,7 +21,7 @@ RuntimeScheduler::RuntimeScheduler( std::function now) : runtimeExecutor_(std::move(runtimeExecutor)), now_(std::move(now)) {} -void RuntimeScheduler::scheduleWork(RawCallback callback) const { +void RuntimeScheduler::scheduleWork(RawCallback&& callback) const noexcept { SystraceSection s("RuntimeScheduler::scheduleWork"); runtimeAccessRequests_ += 1; @@ -37,7 +37,7 @@ void RuntimeScheduler::scheduleWork(RawCallback callback) const { std::shared_ptr RuntimeScheduler::scheduleTask( SchedulerPriority priority, - jsi::Function callback) { + jsi::Function&& callback) noexcept { auto expirationTime = now_() + timeoutForSchedulerPriority(priority); auto task = std::make_shared(priority, std::move(callback), expirationTime); @@ -50,7 +50,7 @@ std::shared_ptr RuntimeScheduler::scheduleTask( std::shared_ptr RuntimeScheduler::scheduleTask( SchedulerPriority priority, - RawCallback callback) { + RawCallback&& callback) noexcept { auto expirationTime = now_() + timeoutForSchedulerPriority(priority); auto task = std::make_shared(priority, std::move(callback), expirationTime); @@ -81,7 +81,7 @@ RuntimeSchedulerTimePoint RuntimeScheduler::now() const noexcept { return now_(); } -void RuntimeScheduler::executeNowOnTheSameThread(RawCallback callback) { +void RuntimeScheduler::executeNowOnTheSameThread(RawCallback&& callback) { SystraceSection s("RuntimeScheduler::executeNowOnTheSameThread"); runtimeAccessRequests_ += 1; @@ -166,7 +166,7 @@ void RuntimeScheduler::startWorkLoop(jsi::Runtime& runtime) const { void RuntimeScheduler::executeTask( jsi::Runtime& runtime, - std::shared_ptr task, + const std::shared_ptr& task, bool didUserCallbackTimeout) const { SystraceSection s( "RuntimeScheduler::executeTask", diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h index 7bd1cb103189e0..fa760cbcad1b9d 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h @@ -34,7 +34,7 @@ class RuntimeScheduler final { RuntimeScheduler(RuntimeScheduler&&) = delete; RuntimeScheduler& operator=(RuntimeScheduler&&) = delete; - void scheduleWork(RawCallback callback) const; + void scheduleWork(RawCallback&& callback) const noexcept; /* * Grants access to the runtime synchronously on the caller's thread. @@ -43,7 +43,7 @@ class RuntimeScheduler final { * by dispatching a synchronous event via event emitter in your native * component. */ - void executeNowOnTheSameThread(RawCallback callback); + void executeNowOnTheSameThread(RawCallback&& callback); /* * Adds a JavaScript callback to priority queue with given priority. @@ -53,11 +53,11 @@ class RuntimeScheduler final { */ std::shared_ptr scheduleTask( SchedulerPriority priority, - jsi::Function callback); + jsi::Function&& callback) noexcept; std::shared_ptr scheduleTask( SchedulerPriority priority, - RawCallback callback); + RawCallback&& callback) noexcept; /* * Cancelled task will never be executed. @@ -135,7 +135,7 @@ class RuntimeScheduler final { void executeTask( jsi::Runtime& runtime, - std::shared_ptr task, + const std::shared_ptr& task, bool didUserCallbackTimeout) const; /* diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp index fedf53eeec9e31..081118f2c31ed5 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp @@ -16,7 +16,7 @@ RuntimeSchedulerCallInvoker::RuntimeSchedulerCallInvoker( std::weak_ptr runtimeScheduler) : runtimeScheduler_(std::move(runtimeScheduler)) {} -void RuntimeSchedulerCallInvoker::invokeAsync(CallFunc&& func) { +void RuntimeSchedulerCallInvoker::invokeAsync(CallFunc&& func) noexcept { if (auto runtimeScheduler = runtimeScheduler_.lock()) { runtimeScheduler->scheduleWork( [func = std::move(func)](jsi::Runtime&) { func(); }); @@ -32,7 +32,7 @@ void RuntimeSchedulerCallInvoker::invokeSync(CallFunc&& func) { void RuntimeSchedulerCallInvoker::invokeAsync( SchedulerPriority priority, - CallFunc&& func) { + CallFunc&& func) noexcept { if (auto runtimeScheduler = runtimeScheduler_.lock()) { runtimeScheduler->scheduleTask( priority, [func = std::move(func)](jsi::Runtime&) { func(); }); diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h index e504fdce48d84e..b901f073a02ac4 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h @@ -20,9 +20,10 @@ class RuntimeSchedulerCallInvoker : public CallInvoker { public: RuntimeSchedulerCallInvoker(std::weak_ptr runtimeScheduler); - void invokeAsync(CallFunc&& func) override; + void invokeAsync(CallFunc&& func) noexcept override; void invokeSync(CallFunc&& func) override; - void invokeAsync(SchedulerPriority priority, CallFunc&& func) override; + void invokeAsync(SchedulerPriority priority, CallFunc&& func) noexcept + override; private: /* diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h index 16d6e683cea5a4..ca4e11d8307c70 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h @@ -38,7 +38,7 @@ static inline SchedulerPriority fromRawValue(double value) { } static inline std::chrono::milliseconds timeoutForSchedulerPriority( - SchedulerPriority schedulerPriority) { + SchedulerPriority schedulerPriority) noexcept { switch (schedulerPriority) { case SchedulerPriority::ImmediatePriority: return std::chrono::milliseconds(-1); diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.cpp index 297cdb1d449ddc..24a0357ac83f43 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.cpp @@ -11,7 +11,7 @@ namespace facebook::react { Task::Task( SchedulerPriority priority, - jsi::Function callback, + jsi::Function&& callback, std::chrono::steady_clock::time_point expirationTime) : priority(priority), callback(std::move(callback)), @@ -19,7 +19,7 @@ Task::Task( Task::Task( SchedulerPriority priority, - RawCallback callback, + RawCallback&& callback, std::chrono::steady_clock::time_point expirationTime) : priority(priority), callback(std::move(callback)), diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.h index 0455bc1a0092ee..3447c662dfda6b 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.h @@ -24,12 +24,12 @@ using RawCallback = std::function; struct Task final : public jsi::NativeState { Task( SchedulerPriority priority, - jsi::Function callback, + jsi::Function&& callback, std::chrono::steady_clock::time_point expirationTime); Task( SchedulerPriority priority, - RawCallback callback, + RawCallback&& callback, std::chrono::steady_clock::time_point expirationTime); private: diff --git a/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.cpp b/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.cpp index f265e4590caaff..33b151a1e1fd5f 100644 --- a/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.cpp +++ b/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.cpp @@ -15,7 +15,8 @@ BridgelessJSCallInvoker::BridgelessJSCallInvoker( RuntimeExecutor runtimeExecutor) : runtimeExecutor_(std::move(runtimeExecutor)) {} -void BridgelessJSCallInvoker::invokeAsync(std::function&& func) { +void BridgelessJSCallInvoker::invokeAsync( + std::function&& func) noexcept { runtimeExecutor_([func = std::move(func)](jsi::Runtime& runtime) { func(); }); } diff --git a/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.h b/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.h index 612af02c48326b..bfab788da2fa50 100644 --- a/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.h +++ b/packages/react-native/ReactCommon/react/runtime/BridgelessJSCallInvoker.h @@ -18,7 +18,7 @@ namespace facebook::react { class BridgelessJSCallInvoker : public CallInvoker { public: explicit BridgelessJSCallInvoker(RuntimeExecutor runtimeExecutor); - void invokeAsync(std::function&& func) override; + void invokeAsync(std::function&& func) noexcept override; void invokeSync(std::function&& func) override; private: diff --git a/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.cpp b/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.cpp index 70bfc4a6a25065..e5f3e6813dc923 100644 --- a/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.cpp +++ b/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.cpp @@ -15,7 +15,7 @@ BridgelessNativeMethodCallInvoker::BridgelessNativeMethodCallInvoker( void BridgelessNativeMethodCallInvoker::invokeAsync( const std::string& methodName, - std::function&& func) { + std::function&& func) noexcept { messageQueueThread_->runOnQueue(std::move(func)); } diff --git a/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h b/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h index c26afe83953c57..79f922976e18ff 100644 --- a/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h +++ b/packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h @@ -16,8 +16,9 @@ class BridgelessNativeMethodCallInvoker : public NativeMethodCallInvoker { public: explicit BridgelessNativeMethodCallInvoker( std::shared_ptr messageQueueThread); - void invokeAsync(const std::string& methodName, std::function&& func) - override; + void invokeAsync( + const std::string& methodName, + std::function&& func) noexcept override; void invokeSync(const std::string& methodName, std::function&& func) override;