Re: [whatwg/streams] Change promises-guide references to Web IDL (#1021)

MattiasBuelens commented on this pull request.

All right, I've kept the changes to a minimum, just enough to unblock other spec changes. We can always do a more thorough refactor later on.

We should *in principle* rename (and update?) [the helpers in the reference implementation](https://github.com/whatwg/streams/blob/ae5e0cb41e9f72cdd97f3a6d47bc674c1f4049d1/reference-implementation/lib/helpers.js#L184-L202) to align with Web IDL as well, but that can also wait until another time.

> @@ -884,7 +884,7 @@ for="ReadableStreamAsyncIteratorPrototype">return( <var>value</var> )</h4>
   1. If *this*.[[preventCancel]] is *false*, then:
     1. Let _result_ be ! ReadableStreamReaderGenericCancel(_reader_, _value_).
     1. Perform ! ReadableStreamReaderGenericRelease(_reader_).
-    1. Return the result of <a>reacting</a> to _result_ with a fulfillment handler that returns !
+    1. Return the result of <a>reacting</a> to _result_ with a fulfillment step that returns !

I opted for a singular "fulfillment step" here, because I thought it sounded a bit weird with plural "steps":
> Return the result of reacting to result with fulfillment steps that return ReadableStreamCreateReadResult(value, true, true)


> @@ -5013,13 +5012,13 @@ nothrow>TransformStreamDefaultSinkCloseAlgorithm( <var>stream</var> )</h4>
   1. Let _controller_ be _stream_.[[transformStreamController]].
   1. Let _flushPromise_ be the result of performing _controller_.[[flushAlgorithm]].
   1. Perform ! TransformStreamDefaultControllerClearAlgorithms(_controller_).
-  1. Return the result of <a>transforming</a> _flushPromise_ with:
-    1. A fulfillment handler that performs the following steps:
+  1. Return the result of <a>reacting</a> to _flushPromise_:
+    1. If _flushPromise_ was fulfilled, then:

This was already very close to the new format from [the example](https://heycam.github.io/webidl/#promise-example-addDelay), so I went ahead and refactored it. I must say: I like this new format quite a bit! 😄

> @@ -5365,7 +5364,7 @@ throws>CreateAlgorithmFromUnderlyingMethod ( <var ignore>underlyingObject</var>,
 <var>args</var> )</h4>
 
 <div class="note">
-  PromiseCall is a variant of <a>promise-calling</a> that works on methods.
+  PromiseCall is a variant of <a lt="call a user object's operation">promise-calling</a> that works on methods.

> > Figure out what to do with "promise-calling".
> 
> I commented inline on some possible wording here.

@domenic What was your suggestion for promise-calling? I can't seem to find your comment. 😕 

-- 
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/1021#pullrequestreview-310824443

Received on Sunday, 3 November 2019 16:09:12 UTC