about summary refs log tree commit diff stats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-30 00:19:48 +0200
committerbptato <nincsnevem662@gmail.com>2024-06-20 17:50:22 +0200
commit60dc37269cd2dc8cdf23d9f77680f6af9490032f (patch)
tree9a72ba24daffa546f92704e7e06cf84fded2d89d /src/js
parenta146a22b11cea39bc691417d9d9a1292b7177552 (diff)
downloadchawan-60dc37269cd2dc8cdf23d9f77680f6af9490032f.tar.gz
img, loader: separate out png codec into cgi, misc improvements
* multi-processed and sandboxed PNG decoding & encoding (through local
  CGI)
* improved request body passing (including support for output id as
  response body)
* simplified & faster blob()/text() - now every request starts
  suspended, and OngoingData.buf has been replaced with loader's
  buffering capability
* image caching: we no longer pull bitmaps from the container after
  every single getLines call

Next steps: replace our bespoke PNG decoder with something more usable,
add other decoders, and make them stream.
Diffstat (limited to 'src/js')
-rw-r--r--src/js/console.nim2
-rw-r--r--src/js/jscolor.nim4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/js/console.nim b/src/js/console.nim
index 0de66162..2ea0fa91 100644
--- a/src/js/console.nim
+++ b/src/js/console.nim
@@ -35,7 +35,7 @@ proc clear(console: Console) {.jsfunc.} =
 proc debug(console: Console; ss: varargs[string]) {.jsfunc.} =
   console.log(ss)
 
-proc error(console: Console; ss: varargs[string]) {.jsfunc.} =
+proc error*(console: Console; ss: varargs[string]) {.jsfunc.} =
   console.log(ss)
 
 proc info(console: Console; ss: varargs[string]) {.jsfunc.} =
diff --git a/src/js/jscolor.nim b/src/js/jscolor.nim
index aa6fd8ed..8491e778 100644
--- a/src/js/jscolor.nim
+++ b/src/js/jscolor.nim
@@ -12,10 +12,10 @@ import utils/twtstr
 
 func parseLegacyColor*(s: string): JSResult[RGBColor] =
   if s == "":
-    return err(newTypeError("Color value must not be the empty string"))
+    return errTypeError("Color value must not be the empty string")
   let s = s.strip(chars = AsciiWhitespace).toLowerAscii()
   if s == "transparent":
-    return err(newTypeError("Color must not be transparent"))
+    return errTypeError("Color must not be transparent")
   return ok(parseLegacyColor0(s))
 
 proc toJS*(ctx: JSContext; rgb: RGBColor): JSValue =