mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user