mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
feat(core): update Jint
This commit is contained in:
parent
13f11f4fde
commit
da9c1d9160
|
@ -13,7 +13,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fluid.Core" Version="2.2.15" />
|
||||
<PackageReference Include="Jint" Version="3.0.0-preview-336" />
|
||||
<PackageReference Include="Jint" Version="3.0.0-preview-343" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.9.0" />
|
||||
<PackageReference Include="HierarchicalPropertyDefault" Version="0.1.4-beta-g75fdf624b1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
|
||||
|
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.Threading;
|
||||
using BililiveRecorder.Core.Config.V3;
|
||||
using BililiveRecorder.Core.Scripting.Runtime;
|
||||
using Esprima;
|
||||
using Esprima.Ast;
|
||||
using Jint;
|
||||
using Jint.Native;
|
||||
|
@ -29,9 +28,9 @@ namespace BililiveRecorder.Core.Scripting
|
|||
|
||||
static UserScriptRunner()
|
||||
{
|
||||
setupScript = new JavaScriptParser(new ParserOptions()).ParseScript(@"
|
||||
setupScript = Engine.PrepareScript(@"
|
||||
globalThis.recorderEvents = {};
|
||||
", "internalSetup.js", true);
|
||||
", "internalSetup.js");
|
||||
}
|
||||
|
||||
public UserScriptRunner(GlobalConfig config)
|
||||
|
@ -73,8 +72,7 @@ globalThis.recorderEvents = {};
|
|||
return null;
|
||||
}
|
||||
|
||||
var parser = new JavaScriptParser();
|
||||
var script = parser.ParseScript(source!, "userscript.js", true);
|
||||
var script = Engine.PrepareScript(source!, "userscript.js");
|
||||
|
||||
this.cachedScript = script;
|
||||
this.cachedScriptSource = source;
|
||||
|
|
Loading…
Reference in New Issue
Block a user