Promise rejections don't resolve the argument

Axel Rauschmayer axel at
Sun Dec 28 13:40:00 PST 2014

Regular behavior is (you reject with a 

Promise.resolve(3).then(console.log.bind(console)) // logs 3
Promise.reject(3).catch(console.log.bind(console)) // logs 3

`Promise.resolve()` only unwraps promises passed to it, because that is needed for chaining:

.then(result1 => asyncFunc2()) // (A)
.then(result2 => console.log(result2));

`then` in line (A) returns a promise that is resolved with what its callback returns. Because resolving unwraps, `asyncFunc2` can return a promise and `result2` will contain the result of resolving it (which is what you want for chaining).

> On 28 Dec 2014, at 13:44, raul mihaila <raul.mihaila at> wrote:
> Can somebody please provide a rationale for why promise reject functions don't resolve the argument, if the argument is a promise, before they pass it to the handlers, like promise resolve functions do?
> Promise.resolve(Promise.reject(3)).catch(console.log.bind(console)) // logs 3
> Promise.reject(Promise.resolve(2)).catch(console.log.bind(console)) // logs a promise

Dr. Axel Rauschmayer
axel at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list