diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-23 23:50:14 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-23 23:52:05 +0200 |
commit | e50186dd1112e24cbf74acda0ea2bd4c63ee2ed9 (patch) | |
tree | 756fc3b3a749716b5f188696b03820b0d529936d /src/html/env.nim | |
parent | 65fe1de341be4c6f8a7f1a0ec6d954be463bba29 (diff) | |
download | chawan-e50186dd1112e24cbf74acda0ea2bd4c63ee2ed9.tar.gz |
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.)
Diffstat (limited to 'src/html/env.nim')
-rw-r--r-- | src/html/env.nim | 2 |
1 files changed, 1 insertions, 1 deletions
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) |