From 8b1bf058c4bcbf4e5ca45b0056217266a1ed870c Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 15 Jun 2023 12:27:32 -0700 Subject: [PATCH] Re-enable direct debugging with JSC on iOS 16.4+ (#37914) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37914 Restores https://github.com/facebook/react-native/pull/37874 (reverted earlier today), with fix for `JSCRuntime.cpp` build on Android. Changelog: None Reviewed By: cortinico Differential Revision: D46762984 fbshipit-source-id: 6d56f81b9d0c928887860993b2b729ed96c0734c --- packages/react-native/ReactCommon/jsc/JSCRuntime.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp index fea1d0bc2d33c7..90a11df160a106 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -398,6 +398,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx) stringCounter_(0) #endif { +#ifndef NDEBUG +#ifdef TARGET_OS_MAC + if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) { + JSGlobalContextSetInspectable(ctx_, true); + } +#endif +#endif } JSCRuntime::~JSCRuntime() {