public override bool TryGetMember(GetMemberBinder binder, out object result) { var pname = binder.Name; var jsValue = __GetJsValue(pname); if (jsValue.IsObject()) { result = new DynamicJsValueForDotNet(jsValue.AsObject(), this._engine); } else { result = DynamicConfig.ConvertJsValueToNetObject(jsValue); } return(true); }
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result) { var pname = binder.Name; var jsValue = __GetJsValue(pname); result = null; if (DynamicConfig.IsFunction(jsValue)) { var f = jsValue.AsObject() as Jint.Native.Function.FunctionInstance; jsValue = DynamicConfig.CallFunction(f, args, this._engine); if (jsValue.IsObject()) { result = new DynamicJsValueForDotNet(jsValue.AsObject(), this._engine); } else { result = DynamicConfig.ConvertJsValueToNetObject(jsValue); } return(true); } return(false); }