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

@ -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