Skip to content

Commit cd28758

Browse files
committed
Add macOS tags to RuntimeConfig changes
1 parent 5801132 commit cd28758

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

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

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

19+
// [macOS
1920
void setEnableDebugger(bool enableDebugger);
2021

2122
void setDebuggerName(const std::string &debuggerName);
23+
// macOS]
2224

2325
std::unique_ptr<JSExecutor> createJSExecutor(
2426
std::shared_ptr<ExecutorDelegate> delegate,
@@ -27,8 +29,10 @@ class JSCExecutorFactory : public JSExecutorFactory {
2729
private:
2830
JSIExecutor::RuntimeInstaller runtimeInstaller_;
2931

32+
// [macOS
3033
bool enableDebugger_ = true;
3134
std::string debuggerName_ = "JSC React Native";
35+
// macOS]
3236
};
3337

3438
} // namespace facebook::react

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,26 @@
1313

1414
namespace facebook::react {
1515

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

2021
void JSCExecutorFactory::setDebuggerName(const std::string &debuggerName) {
2122
debuggerName_ = debuggerName;
2223
}
24+
// macOS]
2325

2426
std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(
2527
std::shared_ptr<ExecutorDelegate> delegate,
2628
std::shared_ptr<MessageQueueThread> __unused jsQueue)
2729
{
30+
// [macOS
2831
facebook::jsc::RuntimeConfig rc = {
2932
.enableDebugger = enableDebugger_,
3033
.debuggerName = debuggerName_,
3134
};
3235
return std::make_unique<JSIExecutor>(facebook::jsc::makeJSCRuntime(std::move(rc)), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_);
36+
// macOS]
3337
}
3438
} // namespace facebook::react

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

Lines changed: 6 additions & 0 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(const facebook::jsc::RuntimeConfig& rc);
42+
// macOS]
4143
// Retains ctx
4244
JSCRuntime(JSGlobalContextRef ctx);
4345
~JSCRuntime();
@@ -370,6 +372,7 @@ JSCRuntime::JSCRuntime()
370372
JSGlobalContextRelease(ctx_);
371373
}
372374

375+
// [macOS
373376
JSCRuntime::JSCRuntime(const facebook::jsc::RuntimeConfig& rc)
374377
: JSCRuntime() {
375378
#ifdef _JSC_HAS_INSPECTABLE
@@ -380,6 +383,7 @@ JSCRuntime::JSCRuntime(const facebook::jsc::RuntimeConfig& rc)
380383
JSGlobalContextSetName(ctx_, JSStringCreateWithUTF8CString(rc.debuggerName.c_str()));
381384

382385
}
386+
// macOS]
383387

384388
JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
385389
: ctx_(JSGlobalContextRetain(ctx)),
@@ -1585,9 +1589,11 @@ std::unique_ptr<jsi::Runtime> makeJSCRuntime() {
15851589
return std::make_unique<JSCRuntime>();
15861590
}
15871591

1592+
// [macOS
15881593
std::unique_ptr<jsi::Runtime> makeJSCRuntime(const facebook::jsc::RuntimeConfig& rc) {
15891594
return std::make_unique<JSCRuntime>(rc);
15901595
}
1596+
// macOS]
15911597

15921598
} // namespace jsc
15931599
} // 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(const facebook::jsc::RuntimeConfig& rc);
25+
std::unique_ptr<jsi::Runtime> makeJSCRuntime(const facebook::jsc::RuntimeConfig& rc); // [macOS]
2426

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

0 commit comments

Comments
 (0)