whatwg / streams

Streams Standard
https://streams.spec.whatwg.org/
Other
1.35k stars 160 forks source link

cancelAlgorithmWrapper does not handle cancellation argument #1273

Closed mattco98 closed 8 months ago

mattco98 commented 1 year ago

In the "set up" algorithms for ReadableStream which take cancel algorithms and wrap them (here and here), the wrapper is specified as "an algorithm that runs these steps", and then in the steps, says "Let result be the result of running cancelAlgorithm, if cancelAlgorithm was given, or null otherwise". However, in the rest of the spec, the cancel algorithms take a cancellation reason. To me it seems like the wrapper should accept an argument and pass it on. I'd be happy to submit a PR for a fix if this is unintended, but I just wanted to make sure I wasn't missing anything first.

nidhijaju commented 1 year ago

Yes, it's unintentional and I think we have an open issue already: https://github.com/whatwg/streams/issues/1241. Please feel free to start a PR to fix it :)