public ManticoreEngine Start()
 {
     v8 = new V8ScriptEngine();
     v8.AccessContext = typeof(ManticoreEngine);
     v8.Execute("var manticore = {platform:{name:\"win\"}};");
     ManticoreJsObject = v8.Script.manticore;
     v8.Script.global  = v8.Script;
     nativeServices.Register(this);
     return(this);
 }
Ejemplo n.º 2
0
 public ManticoreEngine Start()
 {
     jsEngine = new Engine();
     jsEngine.ShouldCreateStackTrace = true;
     RunOnJsThread(() =>
     {
         ManticoreJsObject = jsEngine.Object.Construct(EmptyArgs);
         jsEngine.Global.FastAddProperty("manticore", ManticoreJsObject, false, true, false);
         jsEngine.Global.FastAddProperty("global", jsEngine.Global, false, false, false);
         _exports = jsEngine.Object.Construct(EmptyArgs);
         jsEngine.Global.FastAddProperty("exports", _exports, false, false, false);
         _nativeServices.Register(this);
     });
     return(this);
 }