You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: