Beispiel #1
0
        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);
        }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 private object tryCallOne(CB_With_Result fn, object a)
 {
     try
     {
         return(fn(a));
     }
     catch (Exception ex)
     {
         LAST_ERROR = ex;
         return(IS_ERROR);
     }
 }
Beispiel #4
0
 public Promise Catch(CB_With_Result onRejected)
 {
     return(Then(null, onRejected));
 }