Re: [whatwg/xhr] Editorial: adopt Fetch's new approach to callbacks (#311)

@domenic commented on this pull request.



> @@ -851,7 +836,8 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
     </ol>
     <!-- upload complete flag can never be set here I hope -->
 
-    <p>To <a>process response</a> for <var>response</var>, run these steps:
+   <li>
+    <p>Let <var>processResponse</var>, given a <var>response</var>, be these steps:

Well, some callbacks are called synchronously (e.g. readable stream read request steps), and so could theoretically return. But I agree it's an unlikely reading.

It's more that, when I go to scan an algorithm, I want to look for all "return"/"throw" lines and say "that's where the algorithm could terminate". If we allow re-using return to break out of a collection of steps, then I have to mentally discard those in my scan.

I don't have a strong argument for why this is more problematic for me in specs than it is in programming languages. Maybe the lack of syntax highlighting, or the fact that substeps for callbacks look very similar to substeps for if statements. But I hope this help explains my mild preference.

-- 
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/xhr/pull/311#discussion_r574662810

Received on Thursday, 11 February 2021 16:53:18 UTC