mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
fastGet can throw (#19506)
Co-authored-by: Meghan Denny <meghan@bun.sh> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
@@ -563,3 +563,13 @@ describe("stream", () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("should not crash with a getter that throws", () => {
|
||||
expect(() =>
|
||||
new TextDecoder().decode(new Uint8Array(32), {
|
||||
get stream() {
|
||||
throw new Error("stream get error");
|
||||
},
|
||||
}),
|
||||
).toThrowErrorMatchingInlineSnapshot(`"stream get error"`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user