HS: as Date/Set/Map return real JS host objects (+4 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s

- hs-coerce "Date": new case returns (host-new "Date" value)
- hs-coerce "Set": creates real JS Set via host-new + for-each add (was SX list)
- hs-coerce "Map": creates real JS Map via host-new + for-each set (was SX list)
- hs-make "Set"/"Map": use host-new instead of (list)/(dict)
- hs-add-to!, hs-remove-from!, hs-empty-like, hs-append: handle real JS Sets
- hs-run-filtered.js: add hs-is-set? and hs-is-map? natives
- generator: MANUAL_TEST_BODIES for converts-as-Date (×2), as-Set, as-Map
asExpression suite: 36/42 (was 32/42)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 10:04:51 +00:00
parent e9ddf31181
commit 6a40e991b3
4 changed files with 64 additions and 25 deletions

View File

@@ -593,6 +593,8 @@ K.registerNative('host-iter?',([obj])=>obj!=null&&typeof obj[Symbol.iterator]===
K.registerNative('host-to-list',([obj])=>{try{return[...obj];}catch(e){return[];}});
K.registerNative('host-await',a=>{});
K.registerNative('load-library!',()=>false);
K.registerNative('hs-is-set?',a=>a[0] instanceof Set);
K.registerNative('hs-is-map?',a=>a[0] instanceof Map);
// Upstream test fixtures: synchronous stubs matching OCaml run_tests.ml registrations
globalThis.promiseAString = () => 'foo';
globalThis.promiseAnInt = () => 42;