Closed arieh closed 11 years ago
Another issue is that in case 3.2.6.3.2-3 are correct, there is a scenario where return thenable
would fulfill, which would stop the rejection chain:
fulfilled_thenable = {then : function(f){ f(1);}};
promise1.then(null, function(){
return fulfilled_thenable;
}).then(null, function(value){
//will never reach here
});
@arieh, please also see my comments in your recent pull request #32. Promise rejections work much like synchronous catch. The existing tests and the intent of the spec are correct. In your example above, it is indeed correct that the "will never reach here" will, in fact, never be reached because the previous rejection handler successfully returned a fulfilled thenable, indicating that the rejection has been handled.
Have another read through section 3.2.6 of the spec, keeping in mind that promise rejections work like synchronous exceptions.
Closing, but please feel free to ask more questions here.
In test
3.2.6.2
, in case of a rejection, exact value should be passed to the next rejection in chain, even if it is athenable
or apromise
: https://github.com/promises-aplus/promises-tests/blob/master/lib/tests/3.2.6.js#L63-100However, on tests
3.2.6.3.2
and3.2.6.3.3
, test require that incase theonReject
returns athenable
, promise should try to chain itself to that promise. https://github.com/promises-aplus/promises-tests/blob/master/lib/tests/3.2.6.js#L157-272Am I misunderstanding the tests?
This is the only thing blocking me from passing all tests