Skip to content

Promise settlement is only guarded in debug builds #1553

Description

@OskarEichler

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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