Skip to content

Confused about the point of 2.3.2 #297

@jugheadjones10

Description

@jugheadjones10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions