Files
rose-ash/tests
giles 29ef89d473
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
HS: native unwrap sweep — make all 21 host-* natives ABI-compatible
Following the host-call/host-new precedent, audit the remaining natives
that pass user-supplied values into native JS, and unwrap value handles
({_type, __sx_handle}) at the boundary. Patterns:

  host-global         arg[0]  → string name for globalThis lookup
  host-get            arg[1]  → property key
  host-set!           arg[1]  → property key
                      arg[2]  → value being stored
  host-call           arg[1]  → method name (was missing in initial fix)
                      args... → method arguments
  host-call-fn        argList items → function call arguments
                                      (was sxToJs; now also unwraps atoms)
  host-new            arg[0]  → constructor name
                      args... → constructor arguments
  host-make-js-thrower arg[0] → value to throw (must be primitive in JS)
  host-typeof         arg[0]  → recognize wrapped handles and report their
                                underlying type instead of "object"
  host-iter?          arg[0]  → object to test for [Symbol.iterator]
  host-to-list        arg[0]  → object to spread
  host-new-function   args    → param-name strings and body string

All wraps are forward-compatible: _unwrapHandle is a no-op on plain values
returned by the legacy kernel. The shim activates only when the runtime
encounters real wrapped handles from the new kernel.

Verification — 100 tests pass on the new WASM after sweep (test 27
'can append a value to a set' previously broken by Set value-handle
aliasing now resolves correctly).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 21:46:14 +00:00
..