diff options
author | bptato <nincsnevem662@gmail.com> | 2023-05-27 17:14:22 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-01 13:01:44 +0200 |
commit | fce6c2af50b4ae25dfe4c82932492df7cc433969 (patch) | |
tree | 8939b49e4993f22bd01794c75600ec00594f3e32 /src/html | |
parent | e38f831d4d369eacc7e721f4f82e4124003cc61e (diff) | |
download | chawan-fce6c2af50b4ae25dfe4c82932492df7cc433969.tar.gz |
Add some console functions to DOM
Mainly to avoid errors
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/dom.nim | 17 |
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: |