From d36278a41a8e3cf8d11f6056301eed64ef911c5e Mon Sep 17 00:00:00 2001 From: johnche Date: Tue, 11 Jun 2024 15:00:29 +0800 Subject: [PATCH] =?UTF-8?q?[unity]=E4=B9=8B=E5=89=8D=E9=87=8D=E6=9E=84esm?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=8C=E6=B2=A1=E6=8A=8Adebugpath=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E8=84=9A=E6=9C=ACurl=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=96=AD=E7=82=B9=E4=B8=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unity/native_src/Src/BackendEnv.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unity/native_src/Src/BackendEnv.cpp b/unity/native_src/Src/BackendEnv.cpp index 4a73c11959..2205a79030 100644 --- a/unity/native_src/Src/BackendEnv.cpp +++ b/unity/native_src/Src/BackendEnv.cpp @@ -719,10 +719,15 @@ v8::MaybeLocal FBackendEnv::FetchModuleTree(v8::Isolate* isolate, v8 FV8Utils::ThrowException(isolate, "source_text is not a string!"); return v8::MaybeLocal(); } + v8::Local script_url = absolute_file_path; + if (pathForDebug.size() > 0 ) + { + script_url = FV8Utils::V8String(isolate, pathForDebug.c_str()); + } #if defined(V8_94_OR_NEWER) && !defined(WITH_QUICKJS) - v8::ScriptOrigin origin(isolate, absolute_file_path, 0, 0, true, -1, v8::Local(), false, false, true); + v8::ScriptOrigin origin(isolate, script_url, 0, 0, true, -1, v8::Local(), false, false, true); #else - v8::ScriptOrigin origin(absolute_file_path, v8::Integer::New(isolate, 0), v8::Integer::New(isolate, 0), v8::True(isolate), + v8::ScriptOrigin origin(script_url, v8::Integer::New(isolate, 0), v8::Integer::New(isolate, 0), v8::True(isolate), v8::Local(), v8::Local(), v8::False(isolate), v8::False(isolate), v8::True(isolate), v8::PrimitiveArray::New(isolate, 10)); #endif