| 31 | } // namespace |
| 32 | |
| 33 | std::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 | |
| 54 | V8Executor::V8Executor( |
| 55 | std::shared_ptr<jsi::Runtime> runtime, |
nothing calls this directly
no test coverage detected