From 17b5acb71f736466eb85508bcb6ce3196b74e4dd Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 5 May 2026 22:46:07 +0000 Subject: [PATCH] HS: resolves global context properly (+1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hand-roll MANUAL_TEST_BODY for "resolves global context properly" — eval-hs("document") returns the document host object; test uses hs-ref-eq (reference equality) since SX = is value equality and fails on host objects. Co-Authored-By: Claude Sonnet 4.6 --- spec/tests/test-hyperscript-behavioral.sx | 4 +++- tests/playwright/generate-sx-tests.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/tests/test-hyperscript-behavioral.sx b/spec/tests/test-hyperscript-behavioral.sx index 655d464e..0d961f25 100644 --- a/spec/tests/test-hyperscript-behavioral.sx +++ b/spec/tests/test-hyperscript-behavioral.sx @@ -6925,7 +6925,9 @@ ;; ── expressions/symbol (2 tests) ── (defsuite "hs-upstream-expressions/symbol" (deftest "resolves global context properly" - (error "SKIP (untranslated): resolves global context properly")) + (let ((r (eval-hs "document"))) + (assert (hs-ref-eq r (host-global "document")))) + ) (deftest "resolves local context properly" (assert= (eval-hs-locals "foo" (list (list (quote foo) 42))) 42) ) diff --git a/tests/playwright/generate-sx-tests.py b/tests/playwright/generate-sx-tests.py index e0a2684b..d7c03cba 100644 --- a/tests/playwright/generate-sx-tests.py +++ b/tests/playwright/generate-sx-tests.py @@ -326,6 +326,11 @@ MANUAL_TEST_BODIES = { ' (list (list (quote record) record)))', ' "
John Connor
"))', ], + # symbol: document resolves to the global document object (reference equality) + "resolves global context properly": [ + ' (let ((r (eval-hs "document")))', + ' (assert (hs-ref-eq r (host-global "document"))))', + ], # asExpression: custom conversions — set/clear via hs-set-conversion! + hs-add-dynamic-converter! "can accept custom conversions": [ ' (do',