-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6Promise.Promise.prototype.finally does not behave according to spec #336
Comments
Good catch! As a spec reviewer I am embarrassed this slipped past my implementations. I’ll accept a PR, I should have time in the next day or so to fix myself if someone else doesn’t beat me to it |
codeworrior
added a commit
to codeworrior/es6-promise
that referenced
this issue
Sep 7, 2018
-> PR #339. Credits for the finding go to @ThomasChadzelek and @PeterBuchholz. |
stefanpenner
added a commit
that referenced
this issue
Sep 10, 2018
…lback [Fixes #336] Promise.prototype.finally must not fail for a non-callable callback
fix released as v4.2.5 🎉 thanks @codeworrior, @ThomasChadzelek and @PeterBuchholz for the PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to draft 4 of the Promise.prototype.finally spec , the
callback
parameter is kind of optional. When it is not a Callable,then
should be invoked with thecallback
"as is", e.g. something like this:I understand that it doesn't seem to be reasonable to use
finally
without acallback
.But generic code that receives some callback as parameter and propagates it to a
Promise.prototype.finally
now additionally has to check it for being a function.And I guess, a polyfill in general should be as close to the spec as possible.
Chrome 68, Firefox 61, Safari 11.1 all don't fail when executing
The text was updated successfully, but these errors were encountered: