Skip to content

Commit

Permalink
[unity]之前重构esm实现,没把debugpath作为脚本url,导致调试断点不了
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Jun 11, 2024
1 parent 548ecec commit d36278a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions unity/native_src/Src/BackendEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,15 @@ v8::MaybeLocal<v8::Module> FBackendEnv::FetchModuleTree(v8::Isolate* isolate, v8
FV8Utils::ThrowException(isolate, "source_text is not a string!");
return v8::MaybeLocal<v8::Module>();
}
v8::Local<v8::String> 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<v8::Value>(), false, false, true);
v8::ScriptOrigin origin(isolate, script_url, 0, 0, true, -1, v8::Local<v8::Value>(), 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::Integer>(), v8::Local<v8::Value>(), v8::False(isolate), v8::False(isolate), v8::True(isolate),
v8::PrimitiveArray::New(isolate, 10));
#endif
Expand Down

0 comments on commit d36278a

Please sign in to comment.