HS: socket namespaced names + timeout plumbing (+2)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 17s

Native JS wrapper: replace SX dict with (host-new "Object") so
host-set! mutations persist for rpc and closed? updates. bind-path!
uses (host-new "Object") for intermediate namespace nodes so dotted
paths like MyApp.chat bind correctly. Fix _hs_make_rpc_proxy call
wrapper to strip the nil this-arg. Land tests 4+16: namespaced sockets
work, with timeout parses and uses the configured timeout. 5/16 total.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 10:22:09 +00:00
parent a20c9c4625
commit ce39a35c6b
5 changed files with 71 additions and 56 deletions

View File

@@ -590,7 +590,8 @@ function _hs_make_rpc_proxy(wrapper, overrides) {
}
});
}
globalThis._hs_make_rpc_proxy = { call: _hs_make_rpc_proxy };
// host-call passes args as (this_placeholder, ...rest); strip the nil first-arg.
globalThis._hs_make_rpc_proxy = { call: (_, w, overrides) => _hs_make_rpc_proxy(w, overrides) };
const _origLog = console.log;
globalThis.console = { log: () => {}, error: () => {}, warn: () => {}, info: () => {}, debug: () => {} }; // suppress ALL console noise
const _log = _origLog; // keep reference for our own output
@@ -754,7 +755,7 @@ for(let i=startTest;i<Math.min(endTest,testCount);i++){
// Use SX-level guard to catch errors, avoiding __sxR side-channel issues
// Returns a dict with :ok and :error keys
const _dbgR=K.eval(`(define _test-result (_run-test-thunk (get (nth _test-registry ${i}) "thunk")))`);
if(suite==='hs-upstream-socket'&&i<=1292)process.stderr.write(`[D] i=${i} r=${JSON.stringify(_dbgR)?.slice(0,100)}\n`);
if(suite==='hs-upstream-socket'&&i<=1310)process.stderr.write(`[D] i=${i} r=${JSON.stringify(_dbgR)?.slice(0,160)}\n`);
const isOk=K.eval('(get _test-result "ok")');
if(isOk===true){ok=true;}
else{