- From: Mattias Buelens <notifications@github.com>
- Date: Mon, 13 Jul 2020 13:44:23 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1053/review/447587383@github.com>
@MattiasBuelens commented on this pull request. > + 1. Set |backpressurePromise| to undefined. + 1. Add a handler for |port|'s {{MessagePort/messageerror}} event with the following steps: + 1. Let |error| be a new "{{DataCloneError}}" {{DOMException}}. + 1. Perform ! [$CrossRealmTransformSendError$](|port|, |error|). + 1. Perform ! [$WritableStreamDefaultControllerError$](|controller|, |error|). + 1. Disentangle |port|. + 1. Enable |port|'s [=port message queue=]. + 1. Let |startAlgorithm| be an algorithm that returns undefined. + 1. Let |writeAlgorithm| be the following steps, taking a |chunk| argument: + 1. If |backpressurePromise| is undefined, set |backpressurePromise| to + [=a promise resolved with=] undefined. + 1. Return the result of [=reacting=] to |backpressurePromise| with the following + fulfillment steps: + 1. Set |backpressurePromise| to [=a new promise=]. + 1. Let |promise| be ! [$PackAndPostMessageHandlingError$](|port|, "`chunk`", |chunk|). + 1. If |promise| is a rejected promise, disentangle |port|. Perhaps it was important that the port is disentangled synchronously? Not sure. That said, I think a better way to solve this is to make `PackAndPostMessageHandlingError` throw an error instead of returning a rejected promise. That does mean we need to change all of the call sites to turn the abrupt completion into a rejected promise, but I think it's worth it. (There's only three of them.) -- 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/pull/1053#discussion_r453921125
Received on Monday, 13 July 2020 20:44:36 UTC