mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-09 09:48:15 +08:00
The backend converted size_t lengths and indexes to numbers with sitofp. On wasm32 size_t is 32 bits, and an array length reaches 2^32 - 1, so a sparse array of length 4294967295 read -1. sizeToDouble picks uitofp for a 32-bit size_t and keeps sitofp for 64 bits, whose sign bit a length never reaches, so native output is unchanged. An unsettled top-level await always exited 13. Node exits with `process.exitCode || 13` and runs the exit listeners first, which can set process.exitCode again. scr_promise_finish_top_level now notes 13 only when the program set no nonzero exit code, and the pending exit returns the exit code after the listeners, as the other exits do. Three WASI tests still exercised the embedded-JS fallback that native-only compilation removed: an embedded-source fetch scan and two npm fixtures that every target now refuses. They now check the same behavior with static programs: fetch named only in text compiles, a global fetch call reports SC3002, and CommonJS and ESM packages compile and match Node.