diff options
Diffstat (limited to 'src/local')
-rw-r--r-- | src/local/client.nim | 17 | ||||
-rw-r--r-- | src/local/container.nim | 2 | ||||
-rw-r--r-- | src/local/pager.nim | 4 | ||||
-rw-r--r-- | src/local/select.nim | 2 |
4 files changed, 15 insertions, 10 deletions
diff --git a/src/local/client.nim b/src/local/client.nim index 237ee284..af5e89a0 100644 --- a/src/local/client.nim +++ b/src/local/client.nim @@ -30,14 +30,14 @@ import js/base64 import js/console import js/domexception import js/encoding -import js/error +import js/jserror import js/fromjs import js/intl import js/javascript import js/jstypes import js/jsutils -import js/module -import js/opaque +import js/jsmodule +import js/jsopaque import js/timeout import js/tojs import loader/headers @@ -113,7 +113,12 @@ proc interruptHandler(rt: JSRuntime; opaque: pointer): cint {.cdecl.} = return 0 proc runJSJobs(client: Client) = - client.jsrt.runJSJobs(client.console.err) + while true: + let r = client.jsrt.runJSJobs() + if r.isSome: + break + let ctx = r.error + ctx.writeException(client.console.err) proc cleanup(client: Client) = if client.alive: @@ -221,8 +226,8 @@ proc evalAction(client: Client; action: string; arg0: int32): EmptyPromise = client.quit(client.exitCode) if JS_IsException(ret): client.jsctx.writeException(client.console.err) - if JS_IsObject(ret): - let maybep = fromJS[EmptyPromise](ctx, ret) + elif JS_IsObject(ret): + let maybep = fromJSEmptyPromise(ctx, ret) if maybep.isSome: p = maybep.get JS_FreeValue(ctx, ret) diff --git a/src/local/container.nim b/src/local/container.nim index 85a855db..e4901902 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -13,7 +13,7 @@ import io/serversocket import io/socketstream import js/javascript import js/jstypes -import js/regex +import js/jsregex import layout/renderdocument import loader/headers import loader/loader diff --git a/src/local/pager.nim b/src/local/pager.nim index 3d030b57..af9855bc 100644 --- a/src/local/pager.nim +++ b/src/local/pager.nim @@ -21,12 +21,12 @@ import io/socketstream import io/stdio import io/tempfile import io/urlfilter -import js/error +import js/jserror import js/fromjs import js/javascript import js/jstypes import js/jsutils -import js/regex +import js/jsregex import js/tojs import loader/connecterror import loader/headers diff --git a/src/local/select.nim b/src/local/select.nim index cbefea5a..997eff1c 100644 --- a/src/local/select.nim +++ b/src/local/select.nim @@ -1,6 +1,6 @@ import std/unicode -import js/regex +import js/jsregex import server/buffer import types/cell import utils/luwrap |