Fix bug about import hsp in worker

issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I75MLH?from=project-issue

Signed-off-by: changjiaxing <changjiaxing2@huawei.com>
Change-Id: If26673b59c4359f9fce2e58f3fe0cfcd720e0d2a
This commit is contained in:
changjiaxing 2023-05-18 15:11:43 +08:00
parent b266e4cbc8
commit 321519f27e
2 changed files with 11 additions and 0 deletions

View File

@ -1324,6 +1324,7 @@ public:
static void SetModuleName(EcmaVM *vm, const std::string &moduleName);
static std::string GetModuleName(EcmaVM *vm);
static void AllowCrossThreadExecution(EcmaVM *vm);
static void SynchronizVMInfo(EcmaVM *vm, const EcmaVM *hostVM);
private:
static int vmCount_;

View File

@ -3064,4 +3064,14 @@ void JSNApi::AllowCrossThreadExecution(EcmaVM *vm)
vm->GetAssociatedJSThread()->EnableCrossThreadExecution();
}
void JSNApi::SynchronizVMInfo(EcmaVM *vm, const EcmaVM *hostVM)
{
vm->SetBundleName(hostVM->GetBundleName());
vm->SetModuleName(hostVM->GetModuleName());
vm->SetAssetPath(hostVM->GetAssetPath());
vm->SetIsBundlePack(hostVM->IsBundlePack());
vm->GetModuleManager()->SetExecuteMode(hostVM->GetModuleManager()->GetCurrentMode());
vm->SetResolveBufferCallback(hostVM->GetResolveBufferCallback());
}
} // namespace panda