Implement static Response.json (#36589)

Implements https://fetch.spec.whatwg.org/#dom-response-json
Restructured the constructor to follow the spec more closely with a
separate "initialize the response" algorithm.

Testing: There are existing WPT tests for this.

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
Sebastian C 2025-04-25 03:49:21 -05:00 committed by GitHub
parent dc0c067c9b
commit 281d942981
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 215 additions and 179 deletions

View file

@ -29,12 +29,6 @@
[Request interface: new Request('about:blank') must inherit property "duplex" with the proper type]
expected: FAIL
[Response interface: operation json(any, optional ResponseInit)]
expected: FAIL
[Response interface: calling json(any, optional ResponseInit) on new Response() with too few arguments must throw TypeError]
expected: FAIL
[idlharness.any.sharedworker.html]
expected: ERROR
@ -70,12 +64,6 @@
[Request interface: new Request('about:blank') must inherit property "duplex" with the proper type]
expected: FAIL
[Response interface: operation json(any, optional ResponseInit)]
expected: FAIL
[Response interface: calling json(any, optional ResponseInit) on new Response() with too few arguments must throw TypeError]
expected: FAIL
[idlharness.any.serviceworker.html]
expected: ERROR