Skip to content

基于JavaScriptEngineSwitcher的开源项目配合EFFC框架使用做的扩展,主要是将chakra与vroomjs引擎中的js指针类对象转化成c#中的dictionary等对象

Notifications You must be signed in to change notification settings

redwolf0817/EFFC.JavaScriptEngineSwitcher.Extention

Repository files navigation

EFFC.JavaScriptEngineSwitcher.Extention

EFFC.JavaScriptEngineSwitcher.Extention是在JavaScriptEngineSwitcher.Chakra和JavaScriptEngineSwitcher.VroomJs基础上,为了配合EFFC框架的数据结构而做的调整

环境编译

项目包含两个sln,一个用于.Net工程(vs2015),一个用于.Net core工程(vs2017),取下代码编译完成后的dll或nuget包都会释放到EFFC.Release目录

使用说明

因为是JavaScriptEngineSwitcher的框架,所以直接参考JavaScriptEngineSwitcher的相关说明即可,sample如下

using EFFC.ChakraCore;
using EFFC.VRoomJs;

 ...

 JsEngineSwitcher engineSwitcher = JsEngineSwitcher.Instance;

 engineSwitcher.EngineFactories
                .AddEFFCChakraCore()
               .AddEFFCVroom(new EFFCVroomSettings
               {
                  MaxYoungSpaceSize = 4194304,
                  MaxOldSpaceSize = 8388608
             });

switch (name.ToLower())
           {

               case "chakra":
                  engineSwitcher.DefaultEngineName = EFFCChakraCoreJsEngine.EngineName;
                  break;

               case "vroomjs":
                  engineSwitcher.DefaultEngineName = EFFCVroomJsEngine.EngineName;
                    break;
              default:
                   engineSwitcher.DefaultEngineName = EFFCChakraCoreJsEngine.EngineName;
                   break;
          }
          js = engineSwitcher.CreateDefaultEngine();

历史版本

  • 1.0.2:更新JavascriptEngineSwitcher.Chakra到2.4.8
  • 1.0.3:修正获取数组类型的结果时,数据类型未被转化的问题
  • 1.0.4:更新JavascriptEngineSwitcher.Chakra到2.4.10,修正获取数据时遇到DateTime进入死循环的bug,改为直接抛出异常,目前chakra不支持js的Date转DateTime的能力

About

基于JavaScriptEngineSwitcher的开源项目配合EFFC框架使用做的扩展,主要是将chakra与vroomjs引擎中的js指针类对象转化成c#中的dictionary等对象

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages