[whatwg/streams] Propagate reason argument to resolved promise of cancel algorithm (PR #1324)

When the user of the API does no supply a cancel algorithm make sure to
forward the reason argument to the resolved promise.

This changes step 4. of algorithm
SetUpTransformStreamDefaultControllerFromTransformer making sure to
forward the reason argument to the resolved promise. With this change
the reason argument in step 7. 'React to cancelPromise' of algorithm
TransformStreamDefaultSourceCancel will no longer be undefined.

--

I work on the Ladybird browser and think this PR might resolve a spec bug. We have some failing WPT tests in `transform-streams/backpressure/any.html`, specifically:
- writer.closed should resolve after readable is canceled during start
- writer.closed should resolve after readable is canceled with backpressure
- writer.closed should resolve after readable is canceled with no backpressure

Correcting step 4 in SetUpTransformStreamDefaultControllerFromTransformer as described above so that the reason argument is propagated to the resolved promise resolves these failing tests.


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/streams/1324.html" title="Last updated on Aug 20, 2024, 8:12 PM UTC (6fe0f22)">Preview</a> | <a href="https://whatpr.org/streams/1324/53f7c7d...6fe0f22.html" title="Last updated on Aug 20, 2024, 8:12 PM UTC (6fe0f22)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/1324

-- Commit Summary --

  * Propagate reason argument to resolved promise of cancel algorithm

-- File Changes --

    M index.bs (3)

-- Patch Links --

https://github.com/whatwg/streams/pull/1324.patch
https://github.com/whatwg/streams/pull/1324.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1324
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/pull/1324@github.com>

Received on Tuesday, 20 August 2024 20:13:03 UTC