mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
fix(js): 修复使用ESM时,仅使用同步代码报错 (#2592)
This commit is contained in:
@@ -94,11 +94,14 @@ public class ScriptProject
|
||||
{
|
||||
// 清除Document缓存
|
||||
DocumentLoader.Default.DiscardCachedDocuments();
|
||||
await (Task)engine.Evaluate(new DocumentInfo { Category = ModuleCategory.Standard }, code);
|
||||
|
||||
var evaluation = engine.Evaluate(new DocumentInfo { Category = ModuleCategory.Standard }, code);
|
||||
if (evaluation is Task task) await task;
|
||||
}
|
||||
else
|
||||
{
|
||||
await (Task)engine.Evaluate(code);
|
||||
var evaluation = engine.Evaluate(code);
|
||||
if (evaluation is Task task) await task;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user