Skip to content
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

Confused about the point of 2.3.2 #297

Open
jugheadjones10 opened this issue Mar 11, 2022 · 0 comments
Open

Confused about the point of 2.3.2 #297

jugheadjones10 opened this issue Mar 11, 2022 · 0 comments

Comments

@jugheadjones10
Copy link

jugheadjones10 commented Mar 11, 2022

I’m confused about why 2.3.2 doesn’t mention anything about recursively unwrapping thenables like in 2.3.3.3. It just says that “if/when x is fulfilled, fulfill promise with the same value”. But what if that value is a promise? Aren’t we not supposed to fulfill a promise with another promise?

Also, is there a reason we use the function names resolvePromise and rejectPromise in 2.3.3.3 instead of onFulfilled and onRejected like earlier in the documentation?

One hypothesis I have is that 2.3.3.3 is dealing with situations where thenables are “untrustable”, meaning the value that resolvePromise is called with may very well be a thenable, hence necessitating the recursive unwrapping. That would make 2.3.2 make sense, because if our promise is “trustable” then it wouldn’t fulfill with a promise anyway, allowing us to omit recursive unwrapping in 2.3.2. Does this in any way describe what is going on?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant