Restore hyperscript work on stable site base (908f4f80)
Reset to last known-good state (908f4f80) where links, stepper, and
islands all work, then recovered all hyperscript implementation,
conformance tests, behavioral tests, Playwright specs, site sandbox,
IO-aware server loading, and upstream test suite from f271c88a.
Excludes runtime changes (VM resolve hook, VmSuspended browser handler,
sx_ref.ml guard recovery) that need careful re-integration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,22 +10,34 @@
|
||||
(define hs-conf-fails (list))
|
||||
|
||||
;; ── eval-hs: sandbox version uses cek-eval ──────────────────────
|
||||
(define eval-hs
|
||||
(fn (src &rest opts)
|
||||
(let ((sx (hs-to-sx (hs-compile src)))
|
||||
(ctx (if (> (len opts) 0) (first opts) nil)))
|
||||
(let ((bindings (list
|
||||
(list (quote me) nil)
|
||||
(list (quote it) nil)
|
||||
(list (quote result) nil))))
|
||||
(define
|
||||
eval-hs
|
||||
(fn
|
||||
(src &rest opts)
|
||||
(let
|
||||
((sx (hs-to-sx (hs-compile src)))
|
||||
(ctx (if (> (len opts) 0) (first opts) nil)))
|
||||
(let
|
||||
((bindings (list (list (quote me) nil) (list (quote it) nil) (list (quote result) nil) (list (quote hs-add) (list (quote quote) hs-add)) (list (quote hs-falsy?) (list (quote quote) hs-falsy?)) (list (quote hs-strict-eq) (list (quote quote) hs-strict-eq)) (list (quote hs-type-check) (list (quote quote) hs-type-check)) (list (quote hs-type-check-strict) (list (quote quote) hs-type-check-strict)) (list (quote hs-matches?) (list (quote quote) hs-matches?)) (list (quote hs-coerce) (list (quote quote) hs-coerce)) (list (quote hs-contains?) (list (quote quote) hs-contains?)) (list (quote hs-empty?) (list (quote quote) hs-empty?)) (list (quote hs-first) (list (quote quote) hs-first)) (list (quote hs-last) (list (quote quote) hs-last)) (list (quote hs-make-object) (list (quote quote) hs-make-object)) (list (quote hs-template) (list (quote quote) hs-template)) (list (quote modulo) (list (quote quote) modulo)) (list (quote foo) (list (quote quote) {:bar {:doh "foo"} :foo "foo"})) (list (quote identity) (list (quote quote) (fn (x) x))) (list (quote obj) (list (quote quote) {:getValue (fn () 42)})) (list (quote func1) (list (quote quote) (fn () "a"))) (list (quote func2) (list (quote quote) (fn () "b"))) (list (quote value) "<b>hello</b>") (list (quote d) "2024-01-01") (list (quote record) (list (quote quote) {:favouriteColour "bleaux" :age 21 :name "John Connor"})))))
|
||||
(do
|
||||
(when ctx
|
||||
(when
|
||||
ctx
|
||||
(do
|
||||
(when (get ctx "me")
|
||||
(set! bindings (cons (list (quote me) (get ctx "me")) bindings)))
|
||||
(when (get ctx "locals")
|
||||
(when
|
||||
(get ctx "me")
|
||||
(append!
|
||||
bindings
|
||||
(list (quote me) (list (quote quote) (get ctx "me")))))
|
||||
(when
|
||||
(get ctx "locals")
|
||||
(for-each
|
||||
(fn (k) (set! bindings (cons (list (make-symbol k) (get (get ctx "locals") k)) bindings)))
|
||||
(fn
|
||||
(k)
|
||||
(append!
|
||||
bindings
|
||||
(list
|
||||
(make-symbol k)
|
||||
(list (quote quote) (get (get ctx "locals") k)))))
|
||||
(keys (get ctx "locals"))))))
|
||||
(cek-eval (list (quote let) bindings sx)))))))
|
||||
|
||||
@@ -83,8 +95,8 @@
|
||||
{"src" "1 as Foo:Bar" "expected" "Bar1"}
|
||||
{"src" "func(async 1)" "expected" 1}
|
||||
{"src" "\\\\-> true" "expected" true}
|
||||
{"src" "\\\\ x -> x" "expected" true}
|
||||
{"src" "\\\\ x, y -> y" "expected" true}
|
||||
{"src" "\\ x -> x" "expected" true "locals" {"x" true}}
|
||||
{"src" "\\ x, y -> y" "expected" true "locals" {"x" false "y" true}}
|
||||
{"src" "['a', 'ab', 'abc'].map(\\\\ s -> s.length )" "expected" (list 1 2 3)}
|
||||
{"src" "true" "expected" true}
|
||||
{"src" "false" "expected" false}
|
||||
@@ -159,10 +171,10 @@
|
||||
{"src" "'a' matches 'b'" "expected" false}
|
||||
{"src" "'a' does not match '.*'" "expected" false}
|
||||
{"src" "'a' does not match 'b'" "expected" true}
|
||||
{"src" "I contain that" "expected" true}
|
||||
{"src" "that contains me" "expected" true}
|
||||
{"src" "I include that" "expected" true}
|
||||
{"src" "that includes me" "expected" true}
|
||||
{"src" "I contain that" "expected" true "me" (list 1 2 3) "locals" {"that" 1}}
|
||||
{"src" "that contains me" "expected" true "me" 1 "locals" {"that" (list 1 2 3)}}
|
||||
{"src" "I include that" "expected" true "me" "foobar" "locals" {"that" "foo"}}
|
||||
{"src" "that includes me" "expected" true "me" "foo" "locals" {"that" "foobar"}}
|
||||
{"src" "undefined is empty" "expected" true}
|
||||
{"src" "'' is empty" "expected" true}
|
||||
{"src" "[] is empty" "expected" true}
|
||||
@@ -266,17 +278,17 @@
|
||||
{"src" "the first of [1, 2, 3]" "expected" 1}
|
||||
{"src" "the last of [1, 2, 3]" "expected" 3}
|
||||
{"src" "the first of null" "expected" nil}
|
||||
{"src" "foo's foo" "expected" "foo" "locals" {"foo" {"foo" "foo"}}}
|
||||
{"src" "foo's foo" "expected" "foo"}
|
||||
{"src" "foo's foo" "expected" nil}
|
||||
{"src" "my foo" "expected" "foo"}
|
||||
{"src" "my foo" "expected" "foo" "me" {"foo" "foo"}}
|
||||
{"src" "my foo" "expected" nil}
|
||||
{"src" "its foo" "expected" "foo"}
|
||||
{"src" "its foo" "expected" "foo" "locals" {"it" {"foo" "foo"}}}
|
||||
{"src" "its foo" "expected" nil}
|
||||
{"src" "foo.foo" "expected" "foo" "locals" {"foo" {"foo" "foo"}}}
|
||||
{"src" "foo.foo" "expected" "foo"}
|
||||
{"src" "foo.foo" "expected" nil}
|
||||
{"src" "foo of foo" "expected" "foo"}
|
||||
{"src" "bar.doh of foo" "expected" "foo"}
|
||||
{"src" "doh of foo.bar" "expected" "foo"}
|
||||
{"src" "foo of foo" "expected" "foo" "locals" {"foo" {"foo" "foo"}}}
|
||||
{"src" "bar.doh of foo" "expected" "foo" "locals" {"foo" {"bar" {"doh" "foo"}}}}
|
||||
{"src" "doh of foo.bar" "expected" "foo" "locals" {"foo" {"bar" {"doh" "foo"}}}}
|
||||
{"src" "<.badClassThatDoesNotHaveAnyElements/>" "expected" 0}
|
||||
{"src" "some null" "expected" false}
|
||||
{"src" "some 'thing'" "expected" true}
|
||||
@@ -309,8 +321,8 @@
|
||||
{"src" "`https://${foo}`" "expected" "https://bar" "locals" {"foo" "bar"}}
|
||||
{"src" "foo" "expected" 42 "locals" {"foo" 42}}
|
||||
{"src" "'foo' : String" "expected" "foo"}
|
||||
{"src" "null : String" "expected" nil}
|
||||
{"src" "true : String" "expected" 0}
|
||||
{"src" "'foo' : String!" "expected" "foo"}
|
||||
{"src" "null : String!" "expected" 0}
|
||||
{"src" "null : String" "expected" ""}
|
||||
{"src" "true : String" "expected" "true"}
|
||||
{"src" "'foo' : String!" "expected" true}
|
||||
{"src" "null : String!" "expected" false}
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user