-
Notifications
You must be signed in to change notification settings - Fork 185
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
Require a value when calling resolve function of a Promise #1583
Conversation
Make the value passed to ResolveFunc non-optional. This allows to skip some if-checks when handling receiving resolved value in a fullfill function. This also aligns the behavior with a recent change in Typescript [1]. [1] https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#resolves-parameters-are-no-longer-optional-in-promises
This reverts commit 725ec67.
Tricky one that mypy type error. Even though the ResolveFunc requires an argument now, |
What's the plan here? Is this supposed to be merged before #1582 ? |
I'd have to figure out how to fix the mypy issue first and so far I'm not sure. |
I've made the argument to Promise.[resolve|on_main_thread|on_async_thread] non-optional. You decide if that's an OK solution. I don't hate it, I think being explicit is not a bad thing. |
Make the value passed to ResolveFunc non-optional. This allows to
skip some if-checks when handling resolved value in a fullfill
function.
This also aligns the behavior with a recent change in Typescript [1].
[1] https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#resolves-parameters-are-no-longer-optional-in-promises