diff --git a/jsapi/worker/worker.cpp b/jsapi/worker/worker.cpp index 0a1f3ab4a65c80d8126c407531ac04b0cece6e51..c7f2f4c3f32b06f98a5f93f32001855bee794d2d 100644 --- a/jsapi/worker/worker.cpp +++ b/jsapi/worker/worker.cpp @@ -88,16 +88,9 @@ void Worker::PrepareForWorkerInstance(const Worker* worker) } std::vector scriptContent; OHOS::CCRuntime::Worker::WorkerCore::getAssertFunc(worker->GetScript(), scriptContent); - + HILOG_INFO("worker:: script content size is %{public}d", (int)scriptContent.size()); napi_value execScriptResult = nullptr; -#ifdef USE_ARK_ENGINE napi_run_buffer_script(env, scriptContent, &execScriptResult); -#else - napi_value scriptStringNapiValue = nullptr; - napi_create_string_utf8( - env, reinterpret_cast(scriptContent.data()), scriptContent.size(), &scriptStringNapiValue); - napi_run_script(env, scriptStringNapiValue, &execScriptResult); -#endif if (execScriptResult == nullptr) { // An exception occurred when running the script. HILOG_ERROR("worker:: run script exception occurs, will handle exception");