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:
pfg
2025-05-14 22:14:20 -07:00
committed by GitHub
parent 6090833da6
commit a7b46ebbfe
20 changed files with 93 additions and 92 deletions

View File

@@ -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"`);
});