From e50186dd1112e24cbf74acda0ea2bd4c63ee2ed9 Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 23 Aug 2023 23:50:14 +0200 Subject: dom: add some null checks for window Now that we have established that window *can* be nil. (Though the document.location window null check is probably unnecessary, because it is only called from scripts... but better safe than sorry.) --- src/html/env.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/html/env.nim') diff --git a/src/html/env.nim b/src/html/env.nim index c38852d5..6e81e614 100644 --- a/src/html/env.nim +++ b/src/html/env.nim @@ -89,7 +89,7 @@ proc screenTop(window: Window): int64 {.jsfget.} = 0 #TODO outerWidth, outerHeight proc devicePixelRatio(window: Window): float64 {.jsfget.} = 1 -proc setLocation(window: Window, s: string): Err[DOMException] +proc setLocation(window: Window, s: string): Err[JSError] {.jsfset: "location".} = window.document.setLocation(s) -- cgit 1.4.1-2-gfad0