about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-29 22:53:25 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-29 22:53:25 +0200
commite44e5c93f698f5ddf3168cfcc87a4494ad91641d (patch)
treee00f31b3808733fbb3e2c016c56c1ce412db58f2 /src/display/client.nim
parenta0af8402e3cceea30ec571660faa7fb1032e7527 (diff)
downloadchawan-e44e5c93f698f5ddf3168cfcc87a4494ad91641d.tar.gz
javascript: factor out fromJS
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index c437b75b..fe973b9c 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -35,6 +35,7 @@ import ips/serialize
 import ips/serversocket
 import ips/socketstream
 import js/domexception
+import js/fromjs
 import js/intl
 import js/javascript
 import js/module
@@ -144,8 +145,8 @@ proc command0(client: Client, src: string, filename = "<command>",
     client.jsctx.writeException(client.console.err)
   else:
     if not silence:
-      let str = toString(client.jsctx, ret)
-      if str.issome:
+      let str = fromJS[string](client.jsctx, ret)
+      if str.isSome:
         client.console.err.write(str.get & '\n')
         client.console.err.flush()
   JS_FreeValue(client.jsctx, ret)