HS: take attr semantics fix, +6 tests (509→515/831)

- Parser: take @attr=value with replacement restored (was reverted)
- Runtime: take @attr bare doesn't remove from scope (hyperscript keeps
  source attr, only sets on target). Only take @attr=val with replacement
  modifies scope elements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 14:11:18 +00:00
parent 6bd45daed6
commit fc76a42403
4 changed files with 36 additions and 24 deletions

View File

@@ -114,14 +114,9 @@
((attr-val (if (> (len extra) 0) (first extra) nil))
(with-val (if (> (len extra) 1) (nth extra 1) nil)))
(do
(for-each
(fn
(el)
(if
with-val
(dom-set-attr el name with-val)
(dom-remove-attr el name)))
els)
(when
with-val
(for-each (fn (el) (dom-set-attr el name with-val)) els))
(if
attr-val
(dom-set-attr target name attr-val)