diff options
author | bptato <nincsnevem662@gmail.com> | 2024-08-09 00:29:31 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-08-09 00:29:31 +0200 |
commit | b6b998bf608f2f82d5b639455b2fd6224b0919e2 (patch) | |
tree | 8dd1e2869b64ac584700b6de034db5c667200954 /src/local/client.nim | |
parent | 4c64687290c908cd791a058dede9bd4f2a1c7757 (diff) | |
download | chawan-b6b998bf608f2f82d5b639455b2fd6224b0919e2.tar.gz |
Update monoucha
Diffstat (limited to 'src/local/client.nim')
-rw-r--r-- | src/local/client.nim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/local/client.nim b/src/local/client.nim index f63668d2..d3fd9ebe 100644 --- a/src/local/client.nim +++ b/src/local/client.nim @@ -148,9 +148,9 @@ proc command0(client: Client; src: string; filename = "<command>"; client.jsctx.writeException(client.console.err) else: if not silence: - let str = fromJS[string](client.jsctx, ret) - if str.isSome: - client.console.log(str.get) + var res: string + if client.jsctx.fromJS(ret, res).isSome: + client.console.log(res) JS_FreeValue(client.jsctx, ret) proc command(client: Client; src: string) = @@ -207,9 +207,9 @@ proc evalAction(client: Client; action: string; arg0: int32): EmptyPromise = if JS_IsException(ret): client.jsctx.writeException(client.console.err) elif JS_IsObject(ret): - let maybep = fromJSEmptyPromise(ctx, ret) - if maybep.isSome: - p = maybep.get + var maybep: EmptyPromise + if ctx.fromJS(ret, maybep).isSome: + p = maybep JS_FreeValue(ctx, ret) return p |