about summary refs log tree commit diff stats
path: root/src/html/dom.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/html/dom.nim')
-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