Promises: unhandled rejections and finally()

2020-03-28 Thread Felipe Gasper
Hello, In node 12 as well as the latest Chrome and FF (all on macOS) I see the following: - var y,n; var p = new Promise( (yy,nn) => { y=yy; n=nn } ); n(789); ==> produces 1 unhandled-rejection warning var y,n; var p = new Promise( (yy,nn) => { y=yy; n=nn } ); p.finally( () => {} );

Re: Promises: unhandled rejections and finally()

2020-03-28 Thread Felipe Gasper
Hi Logan, Thank you .. that makes sense. I’m not sure why now but I had in mind that finally() creates a “passthrough” promise that doesn’t affect its parent promise’s resolved/rejected status. Cheers, -Felipe > On Mar 28, 2020, at 21:40, Logan Smyth wrote: > >  > > Could someone point me

Re: Promises: unhandled rejections and finally()

2020-03-28 Thread Logan Smyth
> Could someone point me to something that would help me to understand the logic here? It looks like the first finally() is getting a “free pass” while only the 2nd and subsequent ones trigger their own unhandled-rejection warnings. I think the best place to start in understanding this would be

Re: Promises: unhandled rejections and finally()

2020-03-28 Thread Jordan Harband
It does pass through the fulfillment status - but it does that by adding both an onFulfilled and an onRejected handler, so it does affect the "unhandled rejection" hook. On Sat, Mar 28, 2020 at 7:23 PM Felipe Gasper wrote: > Hi Logan, > > Thank you .. that makes sense. I’m not sure why now but