about summary refs log tree commit diff stats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-11-21 00:36:30 +0100
committerbptato <nincsnevem662@gmail.com>2023-11-21 00:36:30 +0100
commitaa1866cd238c8ebfdd2c1d0aac3d534e5dc94dc1 (patch)
tree9d9a1be03d4dd65c201a907467d9f7193cf2b11a /src/js
parent3cdd0b83862a4e877b13cc6fe00aac95aebc2c0f (diff)
downloadchawan-aa1866cd238c8ebfdd2c1d0aac3d534e5dc94dc1.tar.gz
fromjs: fix fromJSOption with nil
Use option() instead of some()
Diffstat (limited to 'src/js')
-rw-r--r--src/js/fromjs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/fromjs.nim b/src/js/fromjs.nim
index 1d455090..426b04b4 100644
--- a/src/js/fromjs.nim
+++ b/src/js/fromjs.nim
@@ -353,7 +353,7 @@ proc fromJSOption[T](ctx: JSContext, val: JSValue): JSResult[Option[T]] =
     #TODO what about null?
     return err()
   let res = ?fromJS[T](ctx, val)
-  return ok(some(res))
+  return ok(option(res))
 
 # wrap
 proc fromJSOpt[T](ctx: JSContext, val: JSValue): JSResult[T] =