ES6 promises: [[AlreadyResolved]] – needed?

# Axel Rauschmayer (10 years ago)

people.mozilla.org/~jorendorff/es6-draft.html#sec-createresolvingfunctions

Each resolving function R uses R.[[AlreadyResolved]].[[value]] to prevent the same promise from being resolved twice.

Question: Couldn’t R.[[Promise]].[[PromiseState]] be used, instead?

# Axel Rauschmayer (10 years ago)

Figured it out: This is needed for “locking in”.

Quoting 1:

A promise is resolved if it is settled or if it has been "locked in" to match the state of another promise. Attempting to resolve or reject a resolved promise has no effect.