[whatwg/fetch] Proposal: make `Response.json()` compatible with .jsonc (JSON w/ comments) (Issue #1478)

This works:
```javascript
{
 "foo":"bar"
}
```
```javascript
fetch("data:application/json;charset=utf-8;base64,ew0KCSJmb28iOiJiYXIiDQp9") // The JSON from above
 .then((response) => response.json())
 .then((json) => {
  /* Do something with json */
 })

```
But this does not:
```javascript
{
 "foo":"bar" // baz
}
```
```javascript
fetch("data:application/json;charset=utf-8;base64,ew0KCSJmb28iOiJiYXIiIC8vIGJheg0KfQ==")
 .then((response) => response.json())
 /* 
 Uncaught (in promise) SyntaxError: Expected ',' or '}' after property value in JSON at position 16
  */
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1478
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1478@github.com>

Received on Thursday, 11 August 2022 23:43:57 UTC