NETSCRIPT: Compiled modules will be even more shared (#468)

This commit is contained in:
David Walker
2023-04-07 18:08:39 -07:00
committed by GitHub
parent f74002cce0
commit ed9e6d5ea3
10 changed files with 124 additions and 103 deletions
+1 -3
View File
@@ -251,9 +251,7 @@ function makeRuntimeErrorMsg(ctx: NetscriptContext, msg: string, type = "RUNTIME
const userstack = [];
for (const stackline of stack) {
const filename = (() => {
// Filename is current file if url found
if (ws.scriptRef.url && stackline.includes(ws.scriptRef.url)) return ws.scriptRef.filename;
// Also check urls for dependencies
// Check urls for dependencies
for (const [url, script] of ws.scriptRef.dependencies) if (stackline.includes(url)) return script.filename;
// Check for filenames directly if no URL found
if (stackline.includes(ws.scriptRef.filename)) return ws.scriptRef.filename;