about summary refs log tree commit diff stats
path: root/src/local
diff options
context:
space:
mode:
Diffstat (limited to 'src/local')
-rw-r--r--src/local/client.nim17
-rw-r--r--src/local/container.nim2
-rw-r--r--src/local/pager.nim4
-rw-r--r--src/local/select.nim2
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
62' href='#n262'>262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398