Promise finally

Ben Newman benjamin at
Fri Feb 23 15:29:56 UTC 2018

Yes, indeed, I should have said "is required to call `.then` *at least*

It's funny you should mention this nuance, because I recently opened a pull
request against the `Promise.prototype.finally` proposal repository that
would solve exactly this problem, as well as simplifying polyfills by
removing the need for species constructor logic:

I'm fully aware that my PR came too late to affect the most recent edition
of the spec, but perhaps it's not too late to change this behavior in the
next edition. I would be willing to champion this refinement to the
`Promise.prototype.finally` spec text, if TC39 is open to creating fewer
promise objects and calling `.then` fewer times, at the expense of altering
observable spec semantics (only slightly, I would argue, but observably).



His errors are volitional and are the portals of discovery.
-- James Joyce

On Fri, Feb 23, 2018 at 10:19 AM, Raul-Sebastian Mihăilă <
raul.mihaila at> wrote:

> In other words
> ```js
> Promise.resolve().finally(() => {}).then(() => { console.log(1); });
> Promise.resolve().then(() => {}).then(() => { console.log(2); }).then(()
> => { console.log(3); });
> ```
> prints 2, then 3, then 1.
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list