From 2d74b493ee9006e22e199c85b5880da2f482ade1 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Mon, 11 Apr 2022 21:46:17 -0400 Subject: [PATCH] Add sourceURL in comment to fill in stack trace --- src/NetscriptJSEvaluator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetscriptJSEvaluator.ts b/src/NetscriptJSEvaluator.ts index 0295afaa9..aa05f1839 100644 --- a/src/NetscriptJSEvaluator.ts +++ b/src/NetscriptJSEvaluator.ts @@ -202,7 +202,7 @@ function _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): Scri // We automatically define a print function() in the NetscriptJS module so that // accidental calls to window.print() do not bring up the "print screen" dialog - transformedCode += `\n\nfunction print() {throw new Error("Invalid call to window.print(). Did you mean to use Netscript's print()?");}`; + transformedCode += `\n\nfunction print() {throw new Error("Invalid call to window.print(). Did you mean to use Netscript's print()?");}\n//# sourceURL=${script.server}/${script.filename}`; const blob = URL.createObjectURL(makeScriptBlob(transformedCode)); // Push the blob URL onto the top of the stack.