-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Promise.prototype.finally is not aligned with the most current spec draft #161
Comments
OMG. We have hundreds of Sentry issues that I've been debugging for weeks and weeks on and off, made so much worse by the really poor unhandled promise rejection stack I was getting in our react-native environment made this immensely difficult to track down. Turns out I was trusting the types too much and thought it was safe to do myPromiseFn().finally() Because the types say that the argument to finally is optional. I was doing this throughout my code because I was otherwise getting ESLint warnings saying I needed to tl;drThis library requires a function to be provided to
Types ExpectationThe types I find when clicking through to the definition of interface Promise<T> {
finally(onfinally?: (() => void) | undefined | null): Promise<T>
} These types are provided directly from Typescript.
|
According to draft 4 of the Promise.prototype.finally spec , the
callback
parameter might not be callable.Spec: https://tc39.es/proposal-promise-finally/
Similar issues: stefanpenner/es6-promise#336
The text was updated successfully, but these errors were encountered: