mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
25 lines
551 B
TypeScript
25 lines
551 B
TypeScript
import { spawn } from "bun";
|
|
import { test } from "bun:test";
|
|
import { bunExe } from "harness";
|
|
|
|
test("spawn env", async () => {
|
|
const env = {};
|
|
Object.defineProperty(env, "LOL", {
|
|
get() {
|
|
throw new Error("Bad!!");
|
|
},
|
|
configurable: false,
|
|
enumerable: true,
|
|
});
|
|
|
|
// This was the minimum to reliably cause a crash in Bun < v1.1.42
|
|
for (let i = 0; i < 1024 * 10; i++) {
|
|
try {
|
|
const result = spawn({
|
|
env,
|
|
cmd: [bunExe(), "-e", "console.log(process.env.LOL)"],
|
|
});
|
|
} catch (e) {}
|
|
}
|
|
});
|