/// <summary> /// 获得引擎 /// </summary> /// <returns></returns> private Microsoft.ClearScript.V8.V8ScriptEngine GetEngine() { var result = new Microsoft.ClearScript.V8.V8ScriptEngine(); result.AddHostType("Console", typeof(Console)); return(result); }
protected override void InnerEmbedHostType(string itemName, Type type) { try { _jsEngine.AddHostType(itemName, type); } catch (OriginalException e) { throw WrapScriptEngineException(e); } catch (OriginalInterruptedException e) { throw WrapScriptInterruptedException(e); } }