fix ENG-21528 (#24865)

### What does this PR do?
Makes sure we are creating error messages with an allocator that will
not `deinit` at the end of function scope on error.

fixes ENG-21528
### How did you verify your code works?
Added a test
This commit is contained in:
Dylan Conway
2025-11-19 20:31:37 -08:00
committed by GitHub
parent 0054506538
commit b554626662
2 changed files with 9 additions and 3 deletions

View File

@@ -101,6 +101,12 @@ describe("Bun.Transpiler", () => {
hideFromStackTrace(ts.expectPrinted);
hideFromStackTrace(ts.expectParseError);
it("handles errors when parsing macros", () => {
expect(() => {
new Bun.Transpiler({ macro: "hi" });
}).toThrow("Unexpected hi");
});
it("normalizes \\r\\n", () => {
ts.expectPrinted_("console.log(`\r\n\r\n\r\n`)", "console.log(`\n\n\n`);\n");
});