fix(Blob.prototype.stream): handle undefined chunkSize (#24900)

### What does this PR do?
`blob.stream(undefined)`
### How did you verify your code works?
Added a test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Dylan Conway
2025-11-20 17:01:24 -08:00
committed by GitHub
parent b92d2edcff
commit b72ba31441
3 changed files with 13 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
" catch bun.outOfMemory()": 0,
"!= alloc.ptr": 0,
"!= allocator.ptr": 0,
".arguments_old(": 265,
".arguments_old(": 264,
".jsBoolean(false)": 0,
".jsBoolean(true)": 0,
".stdDir()": 42,

View File

@@ -1059,6 +1059,14 @@ it("new Response(stream).blob() (direct)", async () => {
expect(await blob.text()).toBe('{"hello":true}');
});
it("Blob.stream(undefined) does not crash", () => {
var blob = new Blob(["abdefgh"]);
var stream = blob.stream(undefined);
expect(stream instanceof ReadableStream).toBeTrue();
stream = blob.stream(null);
expect(stream instanceof ReadableStream).toBeTrue();
});
it("Blob.stream() -> new Response(stream).text()", async () => {
var blob = new Blob(["abdefgh"]);
var stream = blob.stream();