From 9bf64c43967a3636b16eb48d4e35a4214e8ac9a0 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Mon, 22 Apr 2024 13:59:16 -0700 Subject: [PATCH] Fix Symbol not found: (_JSGlobalContextSetInspectable) (#44185) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44185 This change will fix a symbol not found for JSC Runtime. The `if` check was not a compile time check, therefore the symbol ended up in the binary even if it is not available. Following this post on [Apple forum](https://forums.developer.apple.com/forums/thread/749534), this changes should do the trick. ## Changelog [iOS][Fixed] - Fix Symbol not found: (_JSGlobalContextSetInspectable) Reviewed By: hash3r Differential Revision: D56425834 fbshipit-source-id: a37af51b078bd47a938e6b65d9d8e0f7506e746f --- packages/react-native/ReactCommon/jsc/JSCRuntime.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp index 362d76d0252a95..906ca7cf83467d 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -369,11 +369,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx) { #ifndef NDEBUG #ifdef _JSC_HAS_INSPECTABLE +#if (__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4)) if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) { JSGlobalContextSetInspectable(ctx_, true); } #endif #endif +#endif } JSCRuntime::~JSCRuntime() {