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:
@@ -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))))))
|
||||
|
||||
Reference in New Issue
Block a user