aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-02-06 22:21:39 +0100
committerbptato <nincsnevem662@gmail.com>2025-02-06 22:21:39 +0100
commitebdb900ebc843e93dec4846e2f2434bf18ad8613 (patch)
tree9b2c940d86b6e9e1c029747d71273bd5fe32d97b /src
parentb12b123becace0234cee532a73a80ee1dcb11040 (diff)
downloadchawan-ebdb900ebc843e93dec4846e2f2434bf18ad8613.tar.gz
catom: convert JS_ATOM_NULL to CAtomNull
unsure about the utility of this, but why not
Diffstat (limited to 'src')
-rw-r--r--src/html/catom.nim9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/html/catom.nim b/src/html/catom.nim
index 62451941..5f4889e8 100644
--- a/src/html/catom.nim
+++ b/src/html/catom.nim
@@ -338,9 +338,12 @@ proc fromJS*(ctx: JSContext; val: JSValue; res: var CAtom): Opt[void] =
return ok()
proc fromJS*(ctx: JSContext; val: JSAtom; res: var CAtom): Opt[void] =
- var s: string
- ?ctx.fromJS(val, s)
- res = ctx.getFactoryImpl().toAtom(s)
+ if val == JS_ATOM_NULL:
+ res = CAtomNull
+ else:
+ var s: string
+ ?ctx.fromJS(val, s)
+ res = ctx.getFactoryImpl().toAtom(s)
return ok()
proc fromJS*(ctx: JSContext; val: JSAtom; res: var StaticAtom): Opt[void] =