HS: on EVENT from SRC or EVENT from SRC multi-source listener (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

Parser: limit `from SOURCE` to parse-collection/cmp/arith/poss/atom
  (stops before parse-logical so `or` is not consumed as binary op),
  then collect `or EVENT from SOURCE` pairs via recursive collect-ors!.
  Adds :or-sources key to the on-feature parts list.

Compiler: scan-on gains or-sources param (11th); new :or-sources cond
  clause extracts the list; terminal `true` branch wraps on-call in
  (do on-call (hs-on target event handler) ...) for each extra source.

Test: "can handle an or after a from clause" moved from skip-list to
  MANUAL_TEST_BODIES and now passes (1478/1496).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 15:17:22 +00:00
parent 9f57234d1e
commit f1428009fd
4 changed files with 117 additions and 22 deletions

View File

@@ -111,7 +111,6 @@ SKIP_TEST_NAMES = {
"each behavior installation has its own event queue",
"can catch exceptions thrown in hyperscript functions",
"can catch exceptions thrown in js functions",
"can handle an or after a from clause",
# upstream 'fetch' category — real DocumentFragment semantics (`its childElementCount`
# after `as html`) not exercisable with our DOM mock.
"can do a simple fetch w/ html",
@@ -155,6 +154,22 @@ MANUAL_TEST_BODIES = {
' (assert-contains "foo" _names)',
' (assert-contains "bar" _values))',
],
"can handle an or after a from clause": [
' (hs-cleanup!)',
' (let ((_d1 (dom-create-element "div"))',
' (_d2 (dom-create-element "div"))',
' (_el (dom-create-element "div")))',
' (dom-set-attr _d1 "id" "d1")',
' (dom-set-attr _d2 "id" "d2")',
' (dom-set-attr _el "_" "on click from #d1 or click from #d2 increment @count then put @count into me")',
' (dom-append (dom-body) _d1)',
' (dom-append (dom-body) _d2)',
' (dom-append (dom-body) _el)',
' (hs-activate! _el)',
' (dom-dispatch _d1 "click" nil)',
' (dom-dispatch _d2 "click" nil)',
' (assert= (dom-text-content _el) "2"))',
],
"raises a helpful error when the worker plugin is not installed": [
' (hs-cleanup!)',
' (let ((caught nil))',