about summary refs log tree commit diff stats
path: root/src/html/env.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-11-29 12:43:08 +0100
committerbptato <nincsnevem662@gmail.com>2023-11-29 12:44:38 +0100
commit91b5ed05c485e689eeff3de404fd93c3b792839b (patch)
treefe214ef3bd2801e42ea114f48d6bbf5beda91ee0 /src/html/env.nim
parente60058104562571b20a5c6408b06dfa7d9df866b (diff)
downloadchawan-91b5ed05c485e689eeff3de404fd93c3b792839b.tar.gz
env: add window.top, window.parent
Also, func-ize some similar identity functions, and add TODOs about
[Replaceable].
Diffstat (limited to 'src/html/env.nim')
-rw-r--r--src/html/env.nim15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/html/env.nim b/src/html/env.nim
index 9d0516fe..4c8d4f0c 100644
--- a/src/html/env.nim
+++ b/src/html/env.nim
@@ -101,15 +101,24 @@ proc setLocation(window: Window, s: string): Err[JSError]
     {.jsfset: "location".} =
   window.document.setLocation(s)
 
-proc getWindow(window: Window): Window {.jsuffget: "window".} =
+func getWindow(window: Window): Window {.jsuffget: "window".} =
   return window
 
-proc getSelf(window: Window): Window {.jsfget: "self".} =
+#TODO [Replaceable]
+func getSelf(window: Window): Window {.jsfget: "self".} =
   return window
 
-proc getFrames(window: Window): Window {.jsfget: "frames".} =
+#TODO [Replaceable]
+func getFrames(window: Window): Window {.jsfget: "frames".} =
   return window
 
+func getTop(window: Window): Window {.jsuffget: "top".} =
+  return window #TODO frames?
+
+#TODO [Replaceable]
+func getParent(window: Window): Window {.jsfget: "parent".} =
+  return window #TODO frames?
+
 proc atob(window: Window, data: string): DOMResult[NarrowString] {.jsfunc.} =
   return atob(data)