about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-05-27 17:14:22 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-01 13:01:44 +0200
commitfce6c2af50b4ae25dfe4c82932492df7cc433969 (patch)
tree8939b49e4993f22bd01794c75600ec00594f3e32 /src/html
parente38f831d4d369eacc7e721f4f82e4124003cc61e (diff)
downloadchawan-fce6c2af50b4ae25dfe4c82932492df7cc433969.tar.gz
Add some console functions to DOM
Mainly to avoid errors
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 4bc76a0a..600639ee 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -2002,6 +2002,23 @@ proc log*(console: console, ss: varargs[string]) {.jsfunc.} =
   console.err.write('\n')
   console.err.flush()
 
+proc clear*(console: console) {.jsfunc.} =
+  # Do nothing. By design, we do not allow buffers to clear the console.
+  discard
+
+# For now, these are the same as log().
+proc debug*(console: console, ss: varargs[string]) {.jsfunc.} =
+  console.log(ss)
+
+proc error*(console: console, ss: varargs[string]) {.jsfunc.} =
+  console.log(ss)
+
+proc info*(console: console, ss: varargs[string]) {.jsfunc.} =
+  console.log(ss)
+
+proc warn*(console: console, ss: varargs[string]) {.jsfunc.} =
+  console.log(ss)
+
 proc execute*(element: HTMLScriptElement) =
   let document = element.document
   if document != element.preparationTimeDocument: