script: Implement the Bytes() method on Request and Response (#35250)

* Implement the Bytes() method on Request and Response

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* avoid unsafe code during buffer creation

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
shanehandley 2025-02-02 18:49:48 +11:00 committed by GitHub
parent f364b3f6ea
commit 938baf6bf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 33 additions and 149 deletions

View file

@ -14,16 +14,6 @@
[Request interface: attribute duplex]
expected: FAIL
[Request interface: operation arrayBuffer()]
[Request interface: operation blob()]
[Request interface: operation formData()]
[Request interface: operation json()]
[Request interface: operation text()]
[Request interface: new Request('about:blank') must inherit property "keepalive" with the proper type]
expected: FAIL
@ -42,35 +32,9 @@
[Response interface: operation json(any, optional ResponseInit)]
expected: FAIL
[Response interface: operation arrayBuffer()]
[Response interface: operation blob()]
[Response interface: operation formData()]
[Response interface: operation json()]
[Response interface: operation text()]
[Response interface: calling json(any, optional ResponseInit) on new Response() with too few arguments must throw TypeError]
expected: FAIL
[WorkerGlobalScope interface: operation fetch(RequestInfo, optional RequestInit)]
[WorkerGlobalScope interface: calling fetch(RequestInfo, optional RequestInit) on self with too few arguments must throw TypeError]
[Request interface: operation bytes()]
expected: FAIL
[Request interface: new Request('about:blank') must inherit property "bytes()" with the proper type]
expected: FAIL
[Response interface: operation bytes()]
expected: FAIL
[Response interface: new Response() must inherit property "bytes()" with the proper type]
expected: FAIL
[idlharness.any.sharedworker.html]
expected: ERROR
@ -91,16 +55,6 @@
[Request interface: attribute duplex]
expected: FAIL
[Request interface: operation arrayBuffer()]
[Request interface: operation blob()]
[Request interface: operation formData()]
[Request interface: operation json()]
[Request interface: operation text()]
[Request interface: new Request('about:blank') must inherit property "keepalive" with the proper type]
expected: FAIL
@ -119,35 +73,9 @@
[Response interface: operation json(any, optional ResponseInit)]
expected: FAIL
[Response interface: operation arrayBuffer()]
[Response interface: operation blob()]
[Response interface: operation formData()]
[Response interface: operation json()]
[Response interface: operation text()]
[Response interface: calling json(any, optional ResponseInit) on new Response() with too few arguments must throw TypeError]
expected: FAIL
[Window interface: operation fetch(RequestInfo, optional RequestInit)]
[Window interface: calling fetch(RequestInfo, optional RequestInit) on window with too few arguments must throw TypeError]
[Request interface: operation bytes()]
expected: FAIL
[Request interface: new Request('about:blank') must inherit property "bytes()" with the proper type]
expected: FAIL
[Response interface: operation bytes()]
expected: FAIL
[Response interface: new Response() must inherit property "bytes()" with the proper type]
expected: FAIL
[idlharness.any.serviceworker.html]
expected: ERROR

View file

@ -2,53 +2,11 @@
[Consume FormData request's body as FormData]
expected: FAIL
[Consume String request's body as bytes]
expected: FAIL
[Consume ArrayBuffer request's body as bytes]
expected: FAIL
[Consume Uint8Array request's body as bytes]
expected: FAIL
[Consume Int8Array request's body as bytes]
expected: FAIL
[Consume Float32Array request's body as bytes]
expected: FAIL
[Consume DataView request's body as bytes]
expected: FAIL
[Consume blob response's body as bytes]
expected: FAIL
[request-consume.any.worker.html]
[Consume FormData request's body as FormData]
expected: FAIL
[Consume String request's body as bytes]
expected: FAIL
[Consume ArrayBuffer request's body as bytes]
expected: FAIL
[Consume Uint8Array request's body as bytes]
expected: FAIL
[Consume Int8Array request's body as bytes]
expected: FAIL
[Consume Float32Array request's body as bytes]
expected: FAIL
[Consume DataView request's body as bytes]
expected: FAIL
[Consume blob response's body as bytes]
expected: FAIL
[request-consume.any.serviceworker.html]
expected: ERROR

View file

@ -1,7 +1,4 @@
[response-blob-realm.any.html]
[realm of the Uint8Array from Response bytes()]
expected: FAIL
[response-blob-realm.any.worker.html]
[realm of the Uint8Array from Response bytes()]

View file

@ -1,21 +1,9 @@
[response-error-from-stream.any.worker.html]
[ReadableStream start() Error propagates to Response.bytes() Promise]
expected: FAIL
[ReadableStream pull() Error propagates to Response.bytes() Promise]
expected: FAIL
[response-error-from-stream.any.serviceworker.html]
expected: ERROR
[response-error-from-stream.any.html]
[ReadableStream start() Error propagates to Response.bytes() Promise]
expected: FAIL
[ReadableStream pull() Error propagates to Response.bytes() Promise]
expected: FAIL
[response-error-from-stream.any.sharedworker.html]
expected: ERROR

View file

@ -2,14 +2,8 @@
expected: ERROR
[response-stream-bad-chunk.any.html]
[ReadableStream with non-Uint8Array chunk passed to Response.bytes() causes TypeError]
expected: FAIL
[response-stream-bad-chunk.any.worker.html]
[ReadableStream with non-Uint8Array chunk passed to Response.bytes() causes TypeError]
expected: FAIL
[response-stream-bad-chunk.any.serviceworker.html]
expected: ERROR