mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
10 lines
325 B
TypeScript
10 lines
325 B
TypeScript
// A promise nobody resolves: Node exits 0 when the loop drains even with
|
|
// suspended awaits (the classic gotcha) — matched exactly.
|
|
async function waitsForever(): Promise<void> {
|
|
console.log("suspending");
|
|
await new Promise<void>(() => {});
|
|
console.log("never resumes");
|
|
}
|
|
waitsForever();
|
|
console.log("main done");
|