mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* Support `process.on('beforeExit')` and `process.on('exit')`
* [bun:sqlite] Always call sqlite3_close on exit
* Update process.test.js
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
17 lines
359 B
JavaScript
Generated
17 lines
359 B
JavaScript
Generated
process.on("beforeExit", () => {
|
|
throw new Error("process.on('beforeExit') called");
|
|
});
|
|
|
|
if (process._exiting) {
|
|
throw new Error("process._exiting should be undefined");
|
|
}
|
|
|
|
process.on("exit", () => {
|
|
if (!process._exiting) {
|
|
throw new Error("process.on('exit') called with process._exiting false");
|
|
}
|
|
console.log("PASS");
|
|
});
|
|
|
|
process.exit(0);
|