public void Eval(string chunk, string chunkName = "chunk") { IntPtr resultInfo = PuertsDLL.EvalChecked(isolate, chunk, chunkName); if (resultInfo == IntPtr.Zero) { string exceptionInfo = PuertsDLL.GetLastExceptionInfo(isolate); throw new Exception(exceptionInfo); } PuertsDLL.ResetResult(resultInfo); }
public TResult Eval <TResult>(string chunk, string chunkName = "chunk") { IntPtr resultInfo = PuertsDLL.EvalChecked(isolate, chunk, chunkName); if (resultInfo == IntPtr.Zero) { string exceptionInfo = PuertsDLL.GetLastExceptionInfo(isolate); throw new Exception(exceptionInfo); } TResult result = StaticTranslate <TResult> .Get(Idx, isolate, NativeValueApi.GetValueFromResult, resultInfo, false); PuertsDLL.ResetResult(resultInfo); return(result); }
public void Eval(string chunk, string chunkName = "chunk") { #if THREAD_SAFE lock (this) { #endif IntPtr resultInfo = PuertsDLL.EvalChecked(isolate, chunk, chunkName); if (resultInfo == IntPtr.Zero) { string exceptionInfo = PuertsDLL.GetLastExceptionInfo(isolate); throw new Exception(exceptionInfo); } PuertsDLL.ResetResult(resultInfo); #if THREAD_SAFE } #endif }