HS runtime: fix Boolean coercion to use hs-falsy? — 426→427

as Boolean now uses hs-falsy? for JS-compatible truthiness (0, "", nil, false → false)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 10:24:39 +00:00
parent 4cac08d56f
commit d938682469

View File

@@ -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))