From bfe4282811d53a98fccb564471062e4848df1505 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 7958519e683f6d..dd592007eeb591 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() {