#include "ReanimatedRuntime.h" #include #include #include #include #if JS_RUNTIME_HERMES #include "ReanimatedHermesRuntime.h" #elif JS_RUNTIME_V8 #include #else #if REACT_NATIVE_MINOR_VERSION >= 71 #include #else #include #endif // REACT_NATIVE_MINOR_VERSION #endif // JS_RUNTIME namespace reanimated { using namespace facebook; using namespace react; std::shared_ptr ReanimatedRuntime::make( jsi::Runtime *rnRuntime, std::shared_ptr jsQueue) { #if JS_RUNTIME_HERMES std::unique_ptr runtime = facebook::hermes::makeHermesRuntime(); // We don't call `jsQueue->quitSynchronous()` here, since it will be done // later in ReanimatedHermesRuntime return std::make_shared(std::move(runtime), jsQueue); #elif JS_RUNTIME_V8 // This is required by iOS, because there is an assertion in the destructor // that the thread was indeed `quit` before. jsQueue->quitSynchronous(); auto config = std::make_unique(); config->enableInspector = false; config->appName = "reanimated"; return rnv8::createSharedV8Runtime(rnRuntime, std::move(config)); #else // This is required by iOS, because there is an assertion in the destructor // that the thread was indeed `quit` before jsQueue->quitSynchronous(); return facebook::jsc::makeJSCRuntime(); #endif } } // namespace reanimated