HS: nil guard in hs-on for missing targets (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

When `from #doesntExist` resolves to nil, hs-on silently skips
listener registration instead of crashing on dom-listen nil.
Removes "can ignore when target doesn't exist" from skip-list.

Also adds host-make-js-thrower native utility (plain JS throwing
function, no K.callFn re-entry) — investigated for the js-exceptions
catch test but that test stays skipped: native JS throws from host
calls escape OCaml WASM try-with guards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 14:03:07 +00:00
parent 82d16597e0
commit 1751cd05ea
4 changed files with 31 additions and 10 deletions

View File

@@ -9472,7 +9472,14 @@
(hs-activate! _el-div)
))
(deftest "can ignore when target doesn't exist"
(error "SKIP (skip-list): can ignore when target doesn't exist"))
(hs-cleanup!)
(let ((_el (dom-create-element "div")))
(dom-set-attr _el "_" "on click from #doesntExist throw \"bar\" on click put \"clicked\" into me")
(dom-append (dom-body) _el)
(hs-activate! _el)
(dom-dispatch _el "click" nil)
(assert= (dom-get-inner-html _el) "clicked"))
)
(deftest "can invoke on multiple events"
(hs-cleanup!)
(let ((_el-div (dom-create-element "div")))