added atExit

This commit is contained in:
Olivier Gagnon
2021-10-14 20:13:26 -04:00
parent fe6473f426
commit 3fddb3c9f2
7 changed files with 55 additions and 14 deletions
+7
View File
@@ -3277,6 +3277,13 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
corporation: corporation,
formulas: formulas,
atExit: function (f: any): void {
if (typeof f !== "function") {
throw makeRuntimeErrorMsg("atExit", "argument should be function");
}
workerScript.atExit = f;
},
flags: function (data: any): any {
data = toNative(data);
// We always want the help flag.