A thenable is an object with a `then` method. When a promise’s `resolve` function receives one, the promise adopts its behavior: it follows the thenable’s outcome instead of immediately fulfilling with the object itself. Since promises have a `then` method, one promise can adopt another. section 8.1.1
Keep resolution and settlement distinct:
- A promise is settled only when fulfilled or rejected; once settled, its state and value cannot change. section 8.1.1
- Calling `resolve` with a thenable does not guarantee immediate settlement. If its `then` method never calls a supplied callback, the adopting promise remains pending. section 8.1.1
// Creates a promise that’s permanently pending.
new Promise((resolve) =>
resolve({
then: () => {},
}),
);
This promise adopts a thenable whose `then` method calls no callbacks, so it remains pending. section 8.1.1
