HS cluster 22: simplify win-call emit + def→window + init-blocks test (+1)
- Remove guard wrapper from hs-win-call emit (direct call is sufficient now) - def command also registers fn on window[name] so hs-win-call finds it - Generator: fix \"-escaped quotes in hs-compile string literal (was splitting "here" into three SX nodes) - Hand-rolled deftest for 'can refer to function in init blocks' now passes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2011,13 +2011,12 @@
|
||||
(error "SKIP (skip-list): can pick detail fields out by name"))
|
||||
(deftest "can refer to function in init blocks"
|
||||
(hs-cleanup!)
|
||||
(guard (_e (true nil)) (eval-expr-cek (hs-to-sx (hs-compile "init call foo() end def foo() put \"here\" into #d1's innerHTML end"))))
|
||||
(guard (_e (true nil)) (eval-expr-cek (hs-to-sx (hs-compile "init call foo() end def foo() put \\\"here\\\" into #d1's innerHTML end"))))
|
||||
(let ((_el-d1 (dom-create-element "div")))
|
||||
(dom-set-attr _el-d1 "id" "d1")
|
||||
(dom-append (dom-body) _el-d1)
|
||||
(assert= (dom-text-content (dom-query-by-id "d1")) "here")
|
||||
))
|
||||
(guard (_e (true nil)) (eval-expr-cek (hs-to-sx (hs-compile "init call foo() end def foo() put \"here\" into #d1's innerHTML end"))))
|
||||
(assert= (dom-text-content (dom-query-by-id "d1")) "here"))
|
||||
)
|
||||
(deftest "can remove by clicks elsewhere"
|
||||
(hs-cleanup!)
|
||||
(let ((_el-target (dom-create-element "div")) (_el-other (dom-create-element "div")))
|
||||
|
||||
Reference in New Issue
Block a user