Use aser instead of eval-expr for handler body evaluation

Handler bodies contain HTML elements (div, p, span) which need the
render pipeline. eval-expr treats them as function calls. aser
evaluates and serializes HTML to wire format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 14:14:43 +00:00
parent a0f4ff02a1
commit 87a48ac2aa

View File

@@ -41,9 +41,9 @@
(params body closure)
(if
(or (nil? params) (empty? params))
(eval-expr body closure)
(aser body closure)
(let
((bindings (map (fn (p) (let ((name (if (symbol? p) (symbol-name p) (str p)))) (if (= name "&key") nil (if (= name "&rest") nil (let ((val (or (request-arg name) (request-form name)))) (list (make-symbol name) (or val nil))))))) (filter (fn (p) (let ((name (if (symbol? p) (symbol-name p) (str p)))) (and (not (= name "&key")) (not (= name "&rest"))))) params))))
(let
((let-form (list (quote let) (filter (fn (b) (not (nil? b))) bindings) body)))
(eval-expr let-form closure))))))
(aser let-form closure))))))