public Promise Then(CB_With_Result onFulfilled = null, CB_With_Result onRejected = null) { var res = new Promise(noop); handle(new Handler(onFulfilled, onRejected, res, false)); return(res); }
public Handler(CB_With_Result onFulfilled, CB_With_Result onRejected, Promise promise, bool no_result) { this.onFulfilled = onFulfilled; this.onRejected = onRejected; this.promise = promise; this.no_result = no_result; }
private object tryCallOne(CB_With_Result fn, object a) { try { return(fn(a)); } catch (Exception ex) { LAST_ERROR = ex; return(IS_ERROR); } }
public Promise Catch(CB_With_Result onRejected) { return(Then(null, onRejected)); }