diff --git a/js_concurrent_module/worker/worker.cpp b/js_concurrent_module/worker/worker.cpp index 9cf09f894649db6ee73c40b42314005abe4a48f4..759f30bf434214f890eedb4a5d5fb38a187bb760 100644 --- a/js_concurrent_module/worker/worker.cpp +++ b/js_concurrent_module/worker/worker.cpp @@ -1364,10 +1364,6 @@ void Worker::ExecuteInThread(const void* data) bool Worker::PrepareForWorkerInstance() { std::string rawFileName = script_; - uint8_t* scriptContent = nullptr; - size_t scriptContentSize = 0; - std::vector content; - std::string workerAmi; { std::lock_guard lock(liveStatusLock_); if (HostIsStop() || isHostEnvExited_) { @@ -1390,17 +1386,12 @@ bool Worker::PrepareForWorkerInstance() if (isRelativePath_) { rawFileName = fileName_; } - if (!hostEngine->GetAbcBuffer(rawFileName.c_str(), &scriptContent, &scriptContentSize, content, workerAmi)) { - HILOG_ERROR("worker:: GetAbcBuffer error"); - return false; - } } // add timer interface Timer::RegisterTime(workerEnv_); - HILOG_DEBUG("worker:: stringContent size is %{public}zu", scriptContentSize); napi_value execScriptResult = nullptr; - napi_status status = napi_run_actor(workerEnv_, scriptContent, scriptContentSize, - workerAmi.c_str(), &execScriptResult, const_cast(script_.c_str())); + napi_status status = napi_run_actor(workerEnv_, const_cast(rawFileName.c_str()), + const_cast(script_.c_str()), &execScriptResult); if (status != napi_ok || execScriptResult == nullptr) { // An exception occurred when running the script. HILOG_ERROR("worker:: run script exception occurs, will handle exception");