Skip to content

Commit

Permalink
Fix Symbol not found: (_JSGlobalContextSetInspectable) (#44185)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Apr 22, 2024
1 parent 876914b commit 224ac21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-native/ReactCommon/jsc/JSCRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,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() {
Expand Down

1 comment on commit 224ac21

@linaia
Copy link

@linaia linaia commented on 224ac21 May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I build with XCode 15.3, I have the following error :

/..../node_modules/react-native/ReactCommon/jsc/JSCRuntime.cpp:406:7 Use of undeclared identifier '__AVAILABILITY_INTERNALIPHONE_16_4'

Please sign in to comment.