mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
A computed read through a snapshot of the global object taken in a function (`const g = globalThis; return g[name];`) threw SC2020 for builtin globals: the scan that decides whether a module installs the builtin-global lookup runs before function bodies are lowered, when the snapshot's alias is not registered yet. The scan now also recognizes a variable whose only declaration initializes it with the global object. navigator.language and navigator.languages cache their answers, but only taking the navigator object registered their release at exit, so a program that read just those members left them live and a sanitized build exited with status 99. The first cached value now registers the release. Corpus 8161 reads through a function-local snapshot, and 8168 reads navigator.language, navigator.languages and navigator.platform without the navigator object.