Description
Promise<T> and Promise<void> guard duplicate settlement through assertPromiseState, but that check is compiled only when NITRO_DEBUG is enabled. In release builds, a second resolve/reject can overwrite state, and concurrent settlers can both pass the pre-lock state check.
Expected behavior
Settlement should be single-shot and serialized in every build configuration. A second resolve/reject should throw without changing the original result or rejection.
Reproduction
Create an already-resolved or rejected Promise and settle it again in a non-debug build. The duplicate settlement currently succeeds because the assertion is absent.
Description
Promise<T>andPromise<void>guard duplicate settlement throughassertPromiseState, but that check is compiled only whenNITRO_DEBUGis enabled. In release builds, a second resolve/reject can overwrite state, and concurrent settlers can both pass the pre-lock state check.Expected behavior
Settlement should be single-shot and serialized in every build configuration. A second resolve/reject should throw without changing the original result or rejection.
Reproduction
Create an already-resolved or rejected Promise and settle it again in a non-debug build. The duplicate settlement currently succeeds because the assertion is absent.