public static ConvertStrongTypeToJsValue ( object raw ) : Jint.Native.JsValue | ||
raw | object | |
return | Jint.Native.JsValue |
private object ProcessWithJint(object model, object attrs, object global) { var argument1 = JintProcessorHelper.ConvertStrongTypeToJsValue(model); var argument2 = JintProcessorHelper.ConvertStrongTypeToJsValue(attrs); var argument3 = JintProcessorHelper.ConvertStrongTypeToJsValue(global); using (var lease = _enginePool.Rent()) { return(lease.Resource.Invoke("transform", argument1, argument2, argument3).ToObject()); } }
private static Func <object, object> GetFunc(string funcName, ObjectInstance exports) { var func = exports.Get(funcName); if (func.IsUndefined() || func.IsNull()) { return(null); } if (func.Is <ICallable>()) { return(s => { var model = JintProcessorHelper.ConvertStrongTypeToJsValue(s); return func.Invoke(model).ToObject(); }); } else { throw new InvalidPreprocessorException($"Invalid '{funcName}' variable definition. '{funcName} MUST be a function"); } }