Skip to content

thenable.then is not called syncly? #523

Discussion options

You must be logged in to vote

Yep, you can see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function:

If it's called with a thenable value (including another Promise instance), then the thenable's then method is saved and called in the future (it's always called asynchronously). The then method will be called with two callbacks, which are two new functions with the exact same behaviors as the resolveFunc and rejectFunc passed to the executor function. If calling the then method throws, then the current promise is rejected with the thrown error.

The Promise.resolve page mentions that for non-native promises, it's essentially a shorthand for new Promise((res…

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Worldwidebrine
Comment options

Answer selected by Worldwidebrine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants