!279 ark napi adapt

Merge pull request !279 from songcy-hw/add_napi_support_19
This commit is contained in:
openharmony_ci 2021-10-21 07:31:19 +00:00 committed by Gitee
commit a22ffc1a8c

View File

@ -2787,6 +2787,10 @@ bool JsiEngine::Initialize(const RefPtr<FrontendDelegate>& delegate)
}
nativeEngine_ = new ArkNativeEngine(const_cast<EcmaVM*>(vm), static_cast<void*>(this));
ACE_DCHECK(delegate);
if (delegate && delegate->GetAssetManager()) {
std::string packagePath = delegate->GetAssetManager()->GetPackagePath();
nativeEngine_->SetPackagePath(packagePath);
}
delegate->AddTaskObserver([nativeEngine = nativeEngine_]() {
nativeEngine->Loop(LOOP_NOWAIT);
});