From cfbab3b2f9e480c5be73fcdffeb43d9b3c38694d Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 12 May 2026 21:33:24 +0000 Subject: [PATCH] HS test runner: unwrap value handles in io-wait-event interceptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new WASM ABI wraps numbers, strings, and other atoms as opaque value-handles ({_type, __sx_handle}) inside the perform request args. The io-wait-event mock checks typeof against 'number' and 'string' directly, so under the new ABI: - typeof timeout === 'number' → false (timeout is a handle) - typeof items[2] === 'string' → false (event name is a handle) so the "timeout wins" branch never triggered, and the test fell into the "neither timeout nor event" else that resumed with nil but never fired the post-wait `then add .bar` command. Apply _unwrapHandle to the three args (target, evName, timeout) before the type checks. This is the same pattern the rest of the host-* native sweep already follows (commit 29ef89d4). Effect: hs-upstream-wait goes from 5/7 → 7/7. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/hs-run-filtered.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/hs-run-filtered.js b/tests/hs-run-filtered.js index 273345a4..b5aaa459 100755 --- a/tests/hs-run-filtered.js +++ b/tests/hs-run-filtered.js @@ -885,9 +885,11 @@ globalThis._driveAsync=function driveAsync(r,d){d=d||0;if(_testDeadline && Date. else if(opName==='io-parse-html'){const resp=items&&items[1];const htmlStr=resp&&(resp._html||resp._body)?String(resp._html||resp._body):'';const frag=new El('fragment');frag.nodeType=11;if(htmlStr)frag._setInnerHTML(htmlStr);doResume(frag);} else if(opName==='io-settle')doResume(null); else if(opName==='io-wait-event'){ - const target=items&&items[1]; - const evName=typeof items[2]==='string'?items[2]:''; - const timeout=items&&items.length>3?items[3]:undefined; + const target=_unwrapHandle(items&&items[1]); + const evNameRaw=_unwrapHandle(items&&items[2]); + const evName=typeof evNameRaw==='string'?evNameRaw:''; + const timeoutRaw=items&&items.length>3?_unwrapHandle(items[3]):undefined; + const timeout=typeof timeoutRaw==='number'?timeoutRaw:undefined; if(typeof timeout==='number'){ // `wait for EV or Nms` — timeout wins immediately in the mock (tests use 0ms) doResume(null);