Skip to content

Commit

Permalink
Fix HermesExecutorFactory build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed May 6, 2024
1 parent 362abb9 commit f1145d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <jsi/decorator.h>
#include <jsinspector-modern/InspectorFlags.h>

#include <hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h>
#include <hermes/inspector-modern/chrome/Registration.h>
#include <hermes/inspector/RuntimeAdapter.h>

Expand Down Expand Up @@ -258,7 +259,9 @@ HermesExecutor::HermesExecutor(
jsinspector_modern::RuntimeTargetDelegate&
HermesExecutor::getRuntimeTargetDelegate() {
if (!targetDelegate_) {
targetDelegate_.emplace(hermesRuntime_);
targetDelegate_ =
std::make_unique<jsinspector_modern::HermesRuntimeTargetDelegate>(
hermesRuntime_);
}
return *targetDelegate_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#pragma once

#include <hermes/hermes.h>
#include <hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h>
#include <jsireact/JSIExecutor.h>
#include <utility>

Expand Down Expand Up @@ -62,8 +61,7 @@ class HermesExecutor : public JSIExecutor {
JSIScopedTimeoutInvoker timeoutInvoker_;
std::shared_ptr<jsi::Runtime> runtime_;
std::shared_ptr<hermes::HermesRuntime> hermesRuntime_;
std::optional<jsinspector_modern::HermesRuntimeTargetDelegate>
targetDelegate_;
std::unique_ptr<jsinspector_modern::RuntimeTargetDelegate> targetDelegate_;
};

} // namespace facebook::react

0 comments on commit f1145d4

Please sign in to comment.