diff --git a/React/Base/RCTBridge.h b/React/Base/RCTBridge.h index 5ce3ebe35a3c39..d86a0d27b97b20 100644 --- a/React/Base/RCTBridge.h +++ b/React/Base/RCTBridge.h @@ -160,10 +160,6 @@ RCT_EXTERN void RCTEnableTurboModuleEagerInit(BOOL enabled); RCT_EXTERN BOOL RCTTurboModuleSharedMutexInitEnabled(void); RCT_EXTERN void RCTEnableTurboModuleSharedMutexInit(BOOL enabled); -// Turn on TurboModule block copy -RCT_EXTERN BOOL RCTTurboModuleBlockCopyEnabled(void); -RCT_EXTERN void RCTEnableTurboModuleBlockCopy(BOOL enabled); - // Turn on TurboModule JS Codegen RCT_EXTERN BOOL RCTTurboModuleJSCodegenEnabled(void); RCT_EXTERN void RCTEnableTurboModuleJSCodegen(BOOL enabled); diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index 1adc463bf060e1..d8d5594a12fa1b 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -135,17 +135,6 @@ void RCTEnableTurboModuleSharedMutexInit(BOOL enabled) turboModuleSharedMutexInitEnabled = enabled; } -static BOOL turboModuleBlockCopyEnabled = NO; -BOOL RCTTurboModuleBlockCopyEnabled(void) -{ - return turboModuleBlockCopyEnabled; -} - -void RCTEnableTurboModuleBlockCopy(BOOL enabled) -{ - turboModuleBlockCopyEnabled = enabled; -} - static BOOL turboModuleJSCodegenEnabled = NO; BOOL RCTTurboModuleJSCodegenEnabled(void) { diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm index 4a8dc20832c07e..de1bed23f8ea50 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm @@ -195,11 +195,7 @@ static int32_t getUniqueId() wrapperWasCalled = YES; }; - if (RCTTurboModuleBlockCopyEnabled()) { - return [callback copy]; - } - - return callback; + return [callback copy]; } namespace facebook { @@ -651,13 +647,8 @@ static int32_t getUniqueId() jsInvoker_, methodNameStr, ^(RCTPromiseResolveBlock resolveBlock, RCTPromiseRejectBlock rejectBlock) { - RCTPromiseResolveBlock resolveCopy = resolveBlock; - RCTPromiseRejectBlock rejectCopy = rejectBlock; - - if (RCTTurboModuleBlockCopyEnabled()) { - resolveCopy = [resolveBlock copy]; - rejectCopy = [rejectBlock copy]; - } + RCTPromiseResolveBlock resolveCopy = [resolveBlock copy]; + RCTPromiseRejectBlock rejectCopy = [rejectBlock copy]; [inv setArgument:(void *)&resolveCopy atIndex:count + 2]; [inv setArgument:(void *)&rejectCopy atIndex:count + 3];