adapt ark napi

Change-Id: Ie75db3462042ead5b7785e2f7422a2372e80c734
Signed-off-by: songcongyi <songcongyi1@huawei.com>
This commit is contained in:
songcongyi 2021-10-19 10:21:36 +08:00
parent e840a25b79
commit 3e4b1bba9f

View File

@ -2788,6 +2788,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);
});