From e06b1053658c8ae2b658646de80be00a27d16660 Mon Sep 17 00:00:00 2001 From: Bread Grocery Date: Fri, 24 Apr 2026 10:32:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(js):=20=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=A2=AB=E5=AF=BC=E5=85=A5=E6=97=B6=E5=89=AF=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A2=AB=E9=87=8D=E5=A4=8D=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=20(#3070)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs | 3 ++- BetterGenshinImpact/Core/Script/Project/ScriptProject.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs b/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs index 20836631..14196df9 100644 --- a/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs +++ b/BetterGenshinImpact/Core/Script/PackageDocumentLoader.cs @@ -32,7 +32,8 @@ namespace BetterGenshinImpact.Core.Script { string content = await File.ReadAllTextAsync(targetPath); string processedCode = RewriteScriptCode(content, targetPath); - return new StringDocument(new DocumentInfo(targetPath) { Category = ModuleCategory.Standard }, processedCode); + var documentInfo = new DocumentInfo(new Uri(targetPath)) { Category = ModuleCategory.Standard }; + return new StringDocument(documentInfo, processedCode); } return await Default.LoadDocumentAsync(settings, sourceInfo, specifier, category, contextCallback); diff --git a/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs b/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs index f114f364..99206a26 100644 --- a/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs +++ b/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs @@ -122,7 +122,8 @@ public class ScriptProject string mainScriptPath = Path.Combine(ProjectPath, Manifest.Main); string runtimeCode = loader.RewriteScriptCode(code, mainScriptPath); - var evaluation = engine.Evaluate(new DocumentInfo(mainScriptPath) { Category = ModuleCategory.Standard }, runtimeCode); + var documentInfo = new DocumentInfo(new Uri(mainScriptPath)) { Category = ModuleCategory.Standard }; + var evaluation = engine.Evaluate(documentInfo, runtimeCode); if (evaluation is Task task) await task; } else