Skip to content

Commit 01473cc

Browse files
committed
Add macOS tags
1 parent 11d1211 commit 01473cc

File tree

5 files changed

+34
-16
lines changed

5 files changed

+34
-16
lines changed

packages/react-native/React/CxxBridge/JSCExecutorFactory.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ class JSCExecutorFactory : public JSExecutorFactory {
1717
explicit JSCExecutorFactory(JSIExecutor::RuntimeInstaller runtimeInstaller)
1818
: runtimeInstaller_(std::move(runtimeInstaller)) {}
1919

20+
// [macOS
2021
void setEnableDebugger(bool enableDebugger);
2122

2223
void setDebuggerName(const std::string &debuggerName);
24+
// macOS]
2325

2426
std::unique_ptr<JSExecutor> createJSExecutor(
2527
std::shared_ptr<ExecutorDelegate> delegate,
@@ -28,8 +30,10 @@ class JSCExecutorFactory : public JSExecutorFactory {
2830
private:
2931
JSIExecutor::RuntimeInstaller runtimeInstaller_;
3032

33+
// [macOS
3134
bool enableDebugger_ = true;
3235
std::string debuggerName_ = "JSC React Native";
36+
// macOS]
3337
};
3438

3539
} // namespace react

packages/react-native/React/CxxBridge/JSCExecutorFactory.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,27 @@
1414
namespace facebook {
1515
namespace react {
1616

17+
// [macOS
1718
void JSCExecutorFactory::setEnableDebugger(bool enableDebugger) {
1819
enableDebugger_ = enableDebugger;
1920
}
2021

2122
void JSCExecutorFactory::setDebuggerName(const std::string &debuggerName) {
2223
debuggerName_ = debuggerName;
2324
}
25+
// macOS]
2426

2527
std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(
2628
std::shared_ptr<ExecutorDelegate> delegate,
2729
std::shared_ptr<MessageQueueThread> __unused jsQueue)
2830
{
31+
// [macOS
2932
facebook::jsc::runtimeConfig rc = {
3033
.enableDebugger = enableDebugger_,
3134
.debuggerName = debuggerName_,
3235
};
33-
return std::make_unique<JSIExecutor>(facebook::jsc::makeJSCRuntime(std::move(rc)), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_);
36+
// macOS]
37+
return std::make_unique<JSIExecutor>(facebook::jsc::makeJSCRuntime(std::move(rc)), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_); // [macOS]
3438
}
3539

3640
} // namespace react

packages/react-native/ReactCommon/cxxreact/JSExecutor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class RN_EXPORT JSExecutor {
114114
}
115115

116116
/**
117-
* Returns whether or not the underlying executor supports debugging.
117+
* Returns whether or not the underlying executor supports debugging. // [macOS]
118118
*/
119119
virtual bool isInspectable() {
120120
return false;

packages/react-native/ReactCommon/jsc/JSCRuntime.cpp

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ class JSCRuntime : public jsi::Runtime {
3636
public:
3737
// Creates new context in new context group
3838
JSCRuntime();
39+
// [macOS
3940
// Creates new context in new context group with config
4041
JSCRuntime(facebook::jsc::runtimeConfig &rc);
42+
// macOS]
4143
// Retains ctx
4244
JSCRuntime(JSGlobalContextRef ctx);
4345
~JSCRuntime();
@@ -295,16 +297,18 @@ class JSCRuntime : public jsi::Runtime {
295297
} \
296298
} while (0)
297299

298-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
299-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
300-
#define _JSC_HAS_INSPECTABLE
301-
#endif
302-
#endif
303-
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
304-
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130300
305-
#define _JSC_HAS_INSPECTABLE
306-
#endif
307-
#endif
300+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) // [macOS]
301+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
302+
#define _JSC_HAS_INSPECTABLE
303+
#endif
304+
#endif
305+
// [macOS
306+
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
307+
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130300
308+
#define _JSC_HAS_INSPECTABLE
309+
#endif
310+
#endif
311+
// macOS]
308312

309313
// JSStringRef utilities
310314
namespace {
@@ -380,6 +384,7 @@ JSCRuntime::JSCRuntime()
380384
JSGlobalContextRelease(ctx_);
381385
}
382386

387+
// [macOS
383388
JSCRuntime::JSCRuntime(facebook::jsc::runtimeConfig &rc)
384389
: JSCRuntime() {
385390
#ifdef _JSC_HAS_INSPECTABLE
@@ -390,6 +395,7 @@ JSCRuntime::JSCRuntime(facebook::jsc::runtimeConfig &rc)
390395
JSGlobalContextSetName(ctx_, JSStringCreateWithUTF8CString(rc.debuggerName.c_str()));
391396

392397
}
398+
// macOS]
393399

394400
JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
395401
: ctx_(JSGlobalContextRetain(ctx)),
@@ -480,11 +486,11 @@ std::string JSCRuntime::description() {
480486
}
481487

482488
bool JSCRuntime::isInspectable() {
483-
#ifdef _JSC_HAS_INSPECTABLE
489+
#ifdef _JSC_HAS_INSPECTABLE // [macOS
484490
return JSGlobalContextIsInspectable(ctx_);
485-
#else
491+
#else // macOS]
486492
return false;
487-
#endif
493+
#endif // [macOS]
488494
}
489495

490496
namespace {
@@ -1570,9 +1576,11 @@ std::unique_ptr<jsi::Runtime> makeJSCRuntime() {
15701576
return std::make_unique<JSCRuntime>();
15711577
}
15721578

1579+
// [macOS
15731580
std::unique_ptr<jsi::Runtime> makeJSCRuntime(facebook::jsc::runtimeConfig rc) {
15741581
return std::make_unique<JSCRuntime>(rc);
15751582
}
1583+
// macOS]
15761584

15771585
} // namespace jsc
15781586
} // namespace facebook

packages/react-native/ReactCommon/jsc/JSCRuntime.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
namespace facebook {
1414
namespace jsc {
1515

16+
// [macOS
1617
struct runtimeConfig {
1718
bool enableDebugger;
1819
std::string debuggerName;
1920
};
21+
// macOS]
2022

2123
std::unique_ptr<jsi::Runtime> makeJSCRuntime();
2224

23-
std::unique_ptr<jsi::Runtime> makeJSCRuntime(facebook::jsc::runtimeConfig rc);
25+
std::unique_ptr<jsi::Runtime> makeJSCRuntime(facebook::jsc::runtimeConfig rc); // [macOS]
2426

2527
} // namespace jsc
2628
} // namespace facebook

0 commit comments

Comments
 (0)