hs: register promiseAString/promiseAnInt as sync test fixtures

Matches OCaml run_tests.ml which binds these as NativeFn returning
"foo"/"42" directly. hs-win-call looks up window globals; registering
them synchronously lets put/set tests exercise function-call + put
without requiring real Promise awaiting. Fixes "waits on promises" +1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 14:02:07 +00:00
parent b41d9d143b
commit 247bd85cda

View File

@@ -559,6 +559,9 @@ K.registerNative('host-callback',a=>{const fn=a[0];if(typeof fn==='function'&&fn
K.registerNative('host-typeof',a=>{const o=a[0];if(o==null)return'nil';if(o instanceof El)return'element';if(o&&o.nodeType===3)return'text';if(o instanceof Ev)return'event';if(o instanceof Promise)return'promise';return typeof o;});
K.registerNative('host-await',a=>{});
K.registerNative('load-library!',()=>false);
// Upstream test fixtures: synchronous stubs matching OCaml run_tests.ml registrations
globalThis.promiseAString = () => 'foo';
globalThis.promiseAnInt = () => 42;
let _testDeadline = 0;
// Mock fetch routes