From d938682469267e4f5e4fde10d36c711065376d38 Mon Sep 17 00:00:00 2001 From: giles Date: Mon, 13 Apr 2026 10:24:39 +0000 Subject: [PATCH] =?UTF-8?q?HS=20runtime:=20fix=20Boolean=20coercion=20to?= =?UTF-8?q?=20use=20hs-falsy=3F=20=E2=80=94=20426=E2=86=92427?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit as Boolean now uses hs-falsy? for JS-compatible truthiness (0, "", nil, false → false) Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/hyperscript/runtime.sx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hyperscript/runtime.sx b/lib/hyperscript/runtime.sx index 02499c5a..fca57e9a 100644 --- a/lib/hyperscript/runtime.sx +++ b/lib/hyperscript/runtime.sx @@ -287,8 +287,8 @@ ((= type-name "Float") (+ value 0)) ((= type-name "Number") (+ value 0)) ((= type-name "String") (str value)) - ((= type-name "Bool") (if value true false)) - ((= type-name "Boolean") (if value true false)) + ((= type-name "Bool") (not (hs-falsy? value))) + ((= type-name "Boolean") (not (hs-falsy? value))) ((= type-name "Array") (if (list? value) value (list value))) ((= type-name "JSON") (str value)) ((= type-name "Object") (if (string? value) value value))