diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-29 22:53:25 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-29 22:53:25 +0200 |
commit | e44e5c93f698f5ddf3168cfcc87a4494ad91641d (patch) | |
tree | e00f31b3808733fbb3e2c016c56c1ce412db58f2 /src/display/client.nim | |
parent | a0af8402e3cceea30ec571660faa7fb1032e7527 (diff) | |
download | chawan-e44e5c93f698f5ddf3168cfcc87a4494ad91641d.tar.gz |
javascript: factor out fromJS
Diffstat (limited to 'src/display/client.nim')
-rw-r--r-- | src/display/client.nim | 5 |
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) |