Re: [whatwg/streams] Create a dedicated section for interfacing with other specs (#1073)

@MattiasBuelens commented on this pull request.



> + algorithm <dfn export for="WritableStream/create"><var>abortAlgorithm</var></dfn>, an optional
+ number <dfn export for="WritableStream/create"><var>highWaterMark</var></dfn> (default 1), an
+ optional algorithm <dfn export for="WritableStream/create"><var>sizeAlgorithm</var></dfn>, perform
+ the following steps. |writeAlgorithm| must be an algorithm that accepts a [=chunk=] object and
+ returns a promise. If given, |closeAlgorithm| and |abortAlgorithm| must return a promise. If
+ given, |sizeAlgorithm| must be an algorithm accepting [=chunk=] objects and
+ returning a number; and if given, |highWaterMark| must be a non-negative, non-NaN number.
+
+ 1. Let |startAlgorithm| be an algorithm that returns undefined.
+ 1. Let |closeAlgorithmWrapper| be an algorithm that runs these steps:
+  1. If |closeAlgorithm| was given, return the result of running it.
+  1. Return [=a promise resolved with=] undefined.
+ 1. Let |abortAlgorithmWrapper| be an algorithm that runs these steps:
+  1. If |abortAlgorithm| was given, return the result of running it.
+  1. Return [=a promise resolved with=] undefined.
+ 1. If |sizeAlgorithm| is not given, then set it to an algorithm that returns 1.

I suspect this is because the steps in *closeAlgorithmWrapper* and *abortAlgorithmWrapper* are run **after** the main steps complete.

-- 
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/1073#discussion_r487119642

Received on Friday, 11 September 2020 15:25:37 UTC