Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for setting a Promise as handled to true #565

Open
joanlopez opened this issue Mar 26, 2024 · 0 comments
Open

Support for setting a Promise as handled to true #565

joanlopez opened this issue Mar 26, 2024 · 0 comments

Comments

@joanlopez
Copy link

joanlopez commented Mar 26, 2024

On certain scenarios, like for instance when adding support for Streams API (more specifically to ReadableStreamReaderGenericInitialize), a mechanism to mark a Promise as handled is required, as per spec's requirements:

(from the link above)

...
    // 2. Set reader.[[closedPromise]] to a promise rejected with stream.[[storedError]].
    // 3. Set reader.[[closedPromise]].[[PromiseIsHandled]] to true.

That method I guess would not only set Promise.handled to true, but also do any other operation related with the handling of the Promise.

In Deno, for instance, there's a setPromiseIsHandledToTrue function, used specifically for that.

Alternatively, would be nice to have a more generic set of handlers for Promises management, which would also be handful for this specific use case.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant