- From: Jesper van den Ende <notifications@github.com>
- Date: Sun, 27 Jun 2021 06:00:31 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 27 June 2021 13:00:44 UTC
At the moment the spec takes care of rejected promises in the following way: 1. Create a rejected promise 2. Mark the promise as handled or 1. Reject the promise 2. Mark the promise as handled This happens in [WritableStreamDefaultWriterEnsureClosedPromiseRejected](https://streams.spec.whatwg.org/#writable-stream-default-writer-ensure-closed-promise-rejected) for instance. However, according to the [Promises spec](https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-host-promise-rejection-tracker) the UA needs to do checks the moment a Promise rejects. So if you mark a promise as handled after it rejects, it is already too late. This can be seen from running the following in the console in Chromium: ```js ws = new WritableStream(); writer = ws.getWriter(); writer.releaseLock(); ``` If 'Pause on exceptions' is enabled, script excecution gets paused twice. Once for the `ready` promise and once for the `closed` promise. The Chromium issue for this is tracked in https://crbug.com/1132506 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/1139
Received on Sunday, 27 June 2021 13:00:44 UTC