MISC: Remove unsed attribues of internal ScriptDeath. (#1513)

This commit is contained in:
Tom Prince
2024-07-23 18:50:51 -06:00
committed by GitHub
parent 42bcfa1889
commit 854c1a5921
3 changed files with 3 additions and 14 deletions

View File

@ -76,14 +76,10 @@ export function errorMessage(ctx: NetscriptContext, msg: string, type = "RUNTIME
}
/** Generate an error dialog when workerscript is known */
export function handleUnknownError(e: unknown, ws: WorkerScript | ScriptDeath | null = null, initialText = "") {
export function handleUnknownError(e: unknown, ws: WorkerScript | null = null, initialText = "") {
if (e instanceof ScriptDeath) {
//No dialog for an empty ScriptDeath
if (e.errorMessage === "") return;
if (!ws) {
ws = e;
e = ws.errorMessage;
}
// No dialog for ScriptDeath
return;
}
if (ws && typeof e === "string") {
const headerText = basicErrorMessage(ws, "", "");

View File

@ -20,14 +20,10 @@ export class ScriptDeath {
/** IP Address on which the script was running */
hostname: string;
/** Status message in case of script error. */
errorMessage = "";
constructor(ws: WorkerScript) {
this.pid = ws.pid;
this.name = ws.name;
this.hostname = ws.hostname;
this.errorMessage = ws.errorMessage;
Object.freeze(this);
}

View File

@ -51,9 +51,6 @@ export class WorkerScript {
/** Netscript Environment for this script */
env: Environment;
/** Status message in case of script error. */
errorMessage = "";
/**
* Used for static RAM calculation. Stores names of all functions that have
* already been checked by this script