MCPcopy Create free account
hub / github.com/Kudo/react-native-v8 / createJSExecutor

Method createJSExecutor

android/src/main/cpp/V8ExecutorFactory.cpp:33–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31} // namespace
32
33std::unique_ptr<react::JSExecutor> V8ExecutorFactory::createJSExecutor(
34 std::shared_ptr<react::ExecutorDelegate> delegate,
35 std::shared_ptr<react::MessageQueueThread> jsQueue) {
36 std::unique_ptr<jsi::Runtime> v8Runtime =
37 makeV8RuntimeSystraced(std::move(config_), jsQueue);
38
39 // Add js engine information to Error.prototype so in error reporting we
40 // can send this information.
41 auto errorPrototype = v8Runtime->global()
42 .getPropertyAsObject(*v8Runtime, "Error")
43 .getPropertyAsObject(*v8Runtime, "prototype");
44 errorPrototype.setProperty(*v8Runtime, "jsEngine", "v8");
45
46 return std::make_unique<V8Executor>(
47 std::move(v8Runtime),
48 delegate,
49 jsQueue,
50 timeoutInvoker_,
51 runtimeInstaller_);
52}
53
54V8Executor::V8Executor(
55 std::shared_ptr<jsi::Runtime> runtime,

Callers

nothing calls this directly

Calls 2

makeV8RuntimeSystracedFunction · 0.85
globalMethod · 0.80

Tested by

no test coverage detected