mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
fix thing
This commit is contained in:
@@ -722,8 +722,10 @@ pub const PipeReader = struct {
|
||||
},
|
||||
.array_buffer => {
|
||||
const array_buf_slice = this.array_buffer.buf.slice();
|
||||
if (array_buf_slice.len - this.array_buffer.i < bytes.len) return;
|
||||
@memcpy(array_buf_slice[this.array_buffer.i .. this.array_buffer.i + bytes.len], bytes);
|
||||
// TODO: We should probably throw error here?
|
||||
if (this.array_buffer.i >= array_buf_slice.len) return;
|
||||
const len = @min(array_buf_slice.len - this.array_buffer.i, bytes.len);
|
||||
@memcpy(array_buf_slice[this.array_buffer.i .. this.array_buffer.i + len], bytes[0..len]);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ describe("bunshell", () => {
|
||||
});
|
||||
|
||||
test("syntax edgecase", async () => {
|
||||
const buffer = new Uint8Array(8192);
|
||||
const buffer = new Uint8Array(1 << 20);
|
||||
const shellProc = await $`FOO=bar BUN_TEST_VAR=1 ${BUN} -e "console.log(JSON.stringify(process.env))"> ${buffer}`;
|
||||
|
||||
const str = stringifyBuffer(buffer);
|
||||
|
||||
Reference in New Issue
Block a user