Skip to content

JS_PromiseState might want to document the "not a promise" #1268

@Sytten

Description

@Sytten

Right now the JS_PromiseState doesn't document that it can return -1 if not passing a promise in input.
Not a huge deal but would help us generate a better enum with bindgen in Rust, right now bindgen gives us a c_uint (unsigned int) because no state documented is less than 0.

Suggestion:

typedef enum JSPromiseStateEnum {
    JS_PROMISE_NO_PROMISE = -1,
    JS_PROMISE_PENDING = 0,
    JS_PROMISE_FULFILLED,
    JS_PROMISE_REJECTED,
} JSPromiseStateEnum;

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