Hyperscript examples: add Try it buttons, test stub VM continuation bug

- ~hyperscript/example component: shows "Try it" button with _= attr
  for all on-click examples, source pre wraps long lines
- Added CSS for .active/.light/.dark demo classes with !important
  to override Tailwind hover states
- Added #target div for the "put into" example
- Replaced broken examples (items, ~card, js-date-now) with
  self-contained ones that use available primitives
- Repeat example left in with note: continuation after loop pending
- New test suite io-suspension-continuation documenting the stub VM
  bug: outer do continuation lost after suspension/resume completes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-08 18:20:24 +00:00
parent 33e8788781
commit 71d1ac9ce4
2 changed files with 118 additions and 25 deletions

View File

@@ -85,3 +85,25 @@
(fn () (io "totally-unknown-op-xyz"))
(fn (err) (set! caught true)))
(assert caught))))
(defsuite
"io-suspension-continuation"
(deftest
"code after non-suspending call executes"
(let
((result (list)))
(define f (fn () (set! result (append result "a"))))
(do (f) (set! result (append result "b")))
(assert= result (list "a" "b"))))
(deftest
"continuation after suspending lambda preserves outer do — BROWSER ONLY"
(let
((log (list)))
(define
non-suspending
(fn () (set! log (append log "a")) (set! log (append log "b"))))
(do (non-suspending) (set! log (append log "after-call")))
(assert= log (list "a" "b" "after-call"))
(assert
true
"passes without suspension — browser test needed for full verify: stub VM loses outer do continuation after cek_resume completes"))))