mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-14 12:55:16 +08:00
collectProgram and the runtime-optional array analysis walk every file of the program before any function body is lowered. This change removes work they repeated and moves single checker requests into existing batches. The emitted IR is unchanged. - classReferences reads a per-file index of identifiers by text, built in one walk and kept on ProgramAnalysis, instead of walking every file once per class. - widenedType reads its memo before the syntactic position test, and memoizes nodes without a wide position. - isJsSourceFileName tests the extensions with endsWith. - NanCodedReads groups the identifiers of a name by resolved symbol once, instead of resolving every same-named identifier for every binding. - Each function's return scan in the optional-array fixpoint is a SiteDependencies site, so incremental passes rescan only the returns whose facts changed. - The fixpoint's site batch also types the receivers widenedType reads and for-of iterables, and collectDynamicViews prefetches the values it types in one batch before its walk.