Fix debugger breakpoints fail in worker thread

Issue:  #IAM1WQ
Signed-off-by: yang-19970325 <yangyang585@huawei.com>
This commit is contained in:
yang-19970325 2024-09-02 20:59:48 +08:00
parent b77ed0e804
commit 330478cd0a

View File

@ -1119,10 +1119,6 @@ void JSFunction::InitializeForConcurrentFunction(JSThread *thread, JSHandle<JSFu
ecmascript::CString moduleName = jsPandaFile->GetJSPandaFileDesc();
ecmascript::CString recordName = method->GetRecordNameStr();
// for debugger, to notify the script loaded and parsed which the concurrent function is in
auto *notificationMgr = thread->GetEcmaVM()->GetJsDebuggerManager()->GetNotificationManager();
notificationMgr->LoadModuleEvent(moduleName, recordName);
// check ESM or CJS
ecmascript::JSRecordInfo *recordInfo = nullptr;
bool hasRecord = jsPandaFile->CheckAndGetRecordInfo(recordName, &recordInfo);
@ -1157,6 +1153,10 @@ void JSFunction::InitializeForConcurrentFunction(JSThread *thread, JSHandle<JSFu
} else {
func->SetModule(thread, moduleRecord);
}
// for debugger, to notify the script loaded and parsed which the concurrent function is in
auto *notificationMgr = thread->GetEcmaVM()->GetJsDebuggerManager()->GetNotificationManager();
notificationMgr->LoadModuleEvent(moduleName, recordName);
}
bool JSFunction::IsSendableOrConcurrentFunction() const