about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-22 18:09:12 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-22 18:09:12 +0200
commita9170700b91924a71958a0511196b28add0bd75d (patch)
tree0c8087a6184664d716328f37e7d3a7eb4f1a96ea
parentd58aa56921860f599679331fcf9ff513f9f4ca17 (diff)
downloadchawan-a9170700b91924a71958a0511196b28add0bd75d.tar.gz
dom: use same url in eval filename as in the console.log statement
-rw-r--r--src/html/dom.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index c28cc0e5..0363c0cd 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -2708,12 +2708,12 @@ proc execute*(element: HTMLScriptElement) =
     document.currentScript = element
     if document.window != nil and document.window.jsctx != nil:
       let script = element.scriptResult.script
-      let ret = document.window.jsctx.eval(script.record, $script.baseURL, JS_EVAL_TYPE_GLOBAL)
+      let urls = script.baseURL.serialize(excludepassword = true)
+      let ret = document.window.jsctx.eval(script.record, urls, JS_EVAL_TYPE_GLOBAL)
       if JS_IsException(ret):
         let ss = newStringStream()
         document.window.jsctx.writeException(ss)
         ss.setPosition(0)
-        let urls = document.url.serialize(excludepassword = true)
         document.window.console.log("Exception in document", urls,
           ss.readAll())
     document.currentScript = oldCurrentScript