Fix defhandler blockers: &key params, multi-body, HTML tags
Three fixes in run_tests.ml defhandler parser: 1. Extract &key param names, store in hdef["params"]. run-handler binds them from mock args before evaluating — fixes row-editing, tabs, inline-edit, profile-editing handlers. 2. Capture all body forms after params, wrap in (do ...) when multiple — fixes ex-slow (sleep before let). 3. Register all HTML tags as native fns via Sx_render.html_tags — fixes ex-bulk (tr tag), and enables aser to serialize any tag. 1352 → 1361 passing tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -84,12 +84,24 @@
|
||||
run-handler
|
||||
(fn
|
||||
(hdef)
|
||||
(let
|
||||
((result (aser (get hdef "body") (get hdef "closure"))))
|
||||
(if
|
||||
(sx-expr? result)
|
||||
(sx-expr-source result)
|
||||
(if (string? result) result (str result))))))
|
||||
(do
|
||||
(let
|
||||
((params (get hdef "params")) (closure (get hdef "closure")))
|
||||
(when
|
||||
(and params (not (empty? params)))
|
||||
(for-each
|
||||
(fn
|
||||
(p)
|
||||
(let
|
||||
((val (get _mock-args p)))
|
||||
(env-bind! closure p (or val nil))))
|
||||
params)))
|
||||
(let
|
||||
((result (aser (get hdef "body") (get hdef "closure"))))
|
||||
(if
|
||||
(sx-expr? result)
|
||||
(sx-expr-source result)
|
||||
(if (string? result) result (str result)))))))
|
||||
|
||||
(defsuite
|
||||
"swap:click-to-load"
|
||||
|
||||
Reference in New Issue
Block a user