Re: [whatwg/fetch] Editorial: Amend body reading to use no-promise version (PR #1569)

@MattiasBuelens commented on this pull request.



> +    <a for="entry list">entry</a>, resulting from the parsing operation, to its
+    <a for=FormData>entry list</a>.
+   </ol>
+
+   <p class=XXX>The above is a rough approximation of what is needed for
+   `<code>multipart/form-data</code>`, a more detailed parsing specification is to be
+   written. Volunteers welcome.
+
+   <p>Otherwise, if <var>mimeType</var>'s <a for="MIME type">essence</a> is
+   "<code>application/x-www-form-urlencoded</code>", then:
+
+   <ol>
+    <li><p>Let <var>entries</var> be the result of
+    <a lt="urlencoded parser">parsing</a> <var>bytes</var>.
+
+    <li><p>If <var>entries</var> is failure, then <a>throw</a> a {{TypeError}}.

```suggestion
    <li><p>If <var>entries</var> is failure, then run <var>rejectStep</var> with a {{TypeError}}.
```

> +  <dd><p>Run <var>resolveStep</var> with the result of running <a>parse JSON from bytes</a> on
+  <var>bytes</var>.

This calls into ["parse a JSON string to a JavaScript value"](https://infra.spec.whatwg.org/#parse-a-json-string-to-a-javascript-value), which can throw if the string is not valid JSON. In that case, we should call `rejectStep`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1569#pullrequestreview-1226317369
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1569/review/1226317369@github.com>

Received on Wednesday, 21 December 2022 15:43:05 UTC