Skip to content

Commit d436139

Browse files
author
Nako Sung
committed
required module cache bug fix
1 parent 70a4082 commit d436139

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Plugins/UnrealJS/Source/V8/Private/JavascriptContext_Private.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,9 @@ class FJavascriptContextImplementation : public FJavascriptContext
11881188
auto inner = [&](const FString& script_path)
11891189
{
11901190
auto full_path = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*script_path);
1191+
#if PLATFORM_WINDOWS
1192+
full_path = full_path.Replace(TEXT("/"), TEXT("\\"));
1193+
#endif
11911194
auto it = Self->Modules.Find(full_path);
11921195
if (it)
11931196
{
@@ -1200,9 +1203,6 @@ class FJavascriptContextImplementation : public FJavascriptContext
12001203
if (FFileHelper::LoadFileToString(Text, *script_path))
12011204
{
12021205
Text = FString::Printf(TEXT("(function (global,__dirname) {\nvar module = { exports : {}, filename : __dirname }, exports = module.exports;\n(function () { \n%s\n })()\n;return module.exports;}(this,'%s'));"), *Text, *script_path);
1203-
#if PLATFORM_WINDOWS
1204-
full_path = full_path.Replace(TEXT("/"), TEXT("\\"));
1205-
#endif
12061206
auto exports = Self->RunScript(full_path, Text, 3);
12071207
if (exports.IsEmpty())
12081208
{

0 commit comments

Comments
 (0)