HS: implicit variable declaration, console mock, increment/decrement fix
Integration: - hs-collect-vars: scan compiled SX for set! targets, collect symbols - hs-handler: pre-declare collected variables in closure let-bindings so increment/decrement work on first use (variable persists across event handler calls via closure scope) Compiler: - Fix emit-inc/emit-dec: use expr (variable) not tgt-override (element) - Simplify to plain (set! x (+ x amount)) since vars are pre-declared Mock DOM: - Add mock console object to host-global - Add console handler (no-op) to host-call dispatch - Override console-log/debug/error as no-op primitives to avoid str hitting circular refs in mock DOM elements Fixes 4 log timeouts, 2+ increment/decrement failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -364,10 +364,7 @@
|
||||
(true
|
||||
(let
|
||||
((t (hs-to-sx expr)))
|
||||
(list
|
||||
(quote set!)
|
||||
t
|
||||
(list (quote +) (list (quote or) t 0) amount)))))))
|
||||
(list (quote set!) t (list (quote +) t amount)))))))
|
||||
(define
|
||||
emit-dec
|
||||
(fn
|
||||
@@ -416,10 +413,7 @@
|
||||
(true
|
||||
(let
|
||||
((t (hs-to-sx expr)))
|
||||
(list
|
||||
(quote set!)
|
||||
t
|
||||
(list (quote -) (list (quote or) t 0) amount)))))))
|
||||
(list (quote set!) t (list (quote -) t amount)))))))
|
||||
(define
|
||||
emit-behavior
|
||||
(fn
|
||||
|
||||
Reference in New Issue
Block a user