API: make ns.atExit add the callback to an array instead of setting it (#1059)

This commit is contained in:
Shy
2024-03-06 01:22:45 +01:00
committed by GitHub
parent 4f4c6fe7e5
commit 4aaf845fca
7 changed files with 38 additions and 22 deletions
+2 -2
View File
@@ -78,8 +78,8 @@ export class WorkerScript {
/** hostname on which this script is running */
hostname: string;
/** Function called when the script ends. */
atExit: (() => void) | undefined = undefined;
/**Map of functions called when the script ends. */
atExit: Map<string, () => void> = new Map();
constructor(runningScriptObj: RunningScript, pid: number, nsFuncsGenerator?: (ws: WorkerScript) => NSFull) {
this.name = runningScriptObj.filename;