From 854c1a5921a63ea0c61e8f3bfda50fe9730eca07 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Tue, 23 Jul 2024 18:50:51 -0600 Subject: [PATCH] MISC: Remove unsed attribues of internal `ScriptDeath`. (#1513) --- src/Netscript/ErrorMessages.ts | 10 +++------- src/Netscript/ScriptDeath.ts | 4 ---- src/Netscript/WorkerScript.ts | 3 --- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/Netscript/ErrorMessages.ts b/src/Netscript/ErrorMessages.ts index 35bad6b54..366356db9 100644 --- a/src/Netscript/ErrorMessages.ts +++ b/src/Netscript/ErrorMessages.ts @@ -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, "", ""); diff --git a/src/Netscript/ScriptDeath.ts b/src/Netscript/ScriptDeath.ts index 18300d6ea..abe5f96ba 100644 --- a/src/Netscript/ScriptDeath.ts +++ b/src/Netscript/ScriptDeath.ts @@ -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); } diff --git a/src/Netscript/WorkerScript.ts b/src/Netscript/WorkerScript.ts index cdc22cc01..afd1f55e1 100644 --- a/src/Netscript/WorkerScript.ts +++ b/src/Netscript/WorkerScript.ts @@ -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