From ae4c62a933f7ffcfe4be8a3499fb6e1cbe7f1c43 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 523b1be36937ee..8448d022b026ab 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -403,11 +403,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() {