private ClrFunctionInstance WrapDelegate(EchoDelegate _delegate) { return(Engine.AsJsFunction(new Func <JsValue, JsValue[], JsValue>((thisObject, args) => { _delegate(((args[0].IsNull() || args[0].IsUndefined()) ? null : ManticoreException.NativeInstanceForObject(args[0].AsObject())), Engine.Converter.AsNativeString(args[1])); return JsValue.Undefined; }))); }
private Action <dynamic, dynamic> WrapDelegate(EchoDelegate _delegate) { return(new Action <dynamic, dynamic>((error, arg) => { _delegate((Engine.IsNullOrUndefined(error) ? null : ManticoreException.NativeInstanceForObject(error)), Engine.Converter.AsNativeString(arg)); })); }
private Action <dynamic, dynamic> WrapDelegate(FetchedDelegate _delegate) { return(new Action <dynamic, dynamic>((error, response) => { _delegate((Engine.IsNullOrUndefined(error) ? null : ManticoreException.NativeInstanceForObject(error)), Engine.Converter.AsNativeObject(response)); })); }