mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
`const DOT = 0x2e` at module scope was a global that every reader loaded (a thread-local load in worker programs), hiding the value from integer ranges, switch dispatch and LLVM. foldConstantGlobals rewrites reads of an immutable number or boolean global that the program writes exactly once, with a literal, and that has neither a TDZ sentinel nor an initialization flag (globals that can be read early keep their checked load). The store stays, so namespace objects still find the value. Library builds keep their globals.