From 6e559263724a35cbf8eebae7b154f9b435992da8 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 --- ReactCommon/jsc/JSCRuntime.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ReactCommon/jsc/JSCRuntime.cpp b/ReactCommon/jsc/JSCRuntime.cpp index bbc606561ee353..12a26ba12a02d0 100644 --- a/ReactCommon/jsc/JSCRuntime.cpp +++ b/ReactCommon/jsc/JSCRuntime.cpp @@ -396,6 +396,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() {