thisPromiseRejects.then(fulfillHandler1)
.then(fulfillHandler2, rejectHandler2);
###jQuery rejectionHandler1 and rejectionHandler2 will be called.
###A+ rejectionHandler1 and rejectionHandler2 will be called.
thisPromiseRejects.then(fulfillHandler1, rejectHandler1)
.then(fulfillHandler2, rejectHandler2);
###jQuery rejectionHandler1 and rejectionHandler2 will be called.
###A+ Assuming rejectHandler1 does not throw an error, rejectHandler1 and fulfillHandler2 will be called.
then
must return a promise [3.3].
promise2 = promise1.then(onFulfilled, onRejected);
- If either
onFulfilled
oronRejected
returns a valuex
, run the Promise Resolution Procedure[[Resolve]](promise2, x)
. - If either
onFulfilled
oronRejected
throws an exceptione
,promise2
must be rejected withe
as the reason. - If
onFulfilled
is not a function andpromise1
is fulfilled,promise2
must be fulfilled with the same value aspromise1
. - If
onRejected
is not a function andpromise1
is rejected,promise2
must be rejected with the same reason aspromise1
.