Skip to content

Commit

Permalink
[unity] quickjs dotnet test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Jul 28, 2023
1 parent 8ee4979 commit 0cc6b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion unity/native_src/Src/BackendEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,11 @@ static v8::MaybeLocal<v8::Value> CallRead(
#if !WITH_QUICKJS
v8::Local<v8::Array> pathForDebugRef = v8::Array::New(Isolate, 0);
V8Args.push_back(pathForDebugRef);
v8::MaybeLocal<v8::Value> maybeRet = ModuleReadFunction->Call(Context, Context->Global(), 2, V8Args.data());
#else
v8::MaybeLocal<v8::Value> maybeRet = ModuleReadFunction->Call(Context, Context->Global(), 1, V8Args.data());
#endif

v8::MaybeLocal<v8::Value> maybeRet = ModuleReadFunction->Call(Context, Context->Global(), 2, V8Args.data());
v8::Local<v8::Value> pathForDebugValue;

V8Args.clear();
Expand Down
8 changes: 4 additions & 4 deletions unity/test/dotnet/Src/TxtLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ private string TryResolve(string specifier)
string path = Path.Combine(root, specifier);
if (System.IO.File.Exists(path))
{
return path;
return path.Replace("\\", "/");
}
path = Path.Combine(commonjsRoot, specifier);
if (System.IO.File.Exists(path))
{
return path;
return path.Replace("\\", "/");
}
path = Path.Combine(editorRoot, specifier);
if (System.IO.File.Exists(path))
{
return path;
return path.Replace("\\", "/");
}

path = Path.Combine(unittestRoot, specifier);
if (System.IO.File.Exists(path))
{
return path;
return path.Replace("\\", "/");
}

else if (mockFileContent.ContainsKey(specifier))
Expand Down

0 comments on commit 0cc6b0b

Please sign in to comment.