mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-10 01:56:15 +08:00
join checked each index with HasProperty before reading it, so a proxy's has trap ran, and could hide a value or throw. flat converted its depth only after it had read every index, and flatMap ran every callback before it flattened any result, so a later read or callback could change an array that should already have been copied. - join reads every index with Get alone; a missing index joins as the empty string. - flat converts its depth after the length and before the first index, and flatMap checks its callback there. - Each present value, mapped first for flatMap, is flattened into the result before the next index is read, through the array dispatch's flat over `[value]`. scr_dyn.h declares scr_dyn_array_like_call and scr_dyn_builtin_prototype, the entry points of the two gated units, so every scr_* name the backend can emit has a prototype in scr_runtime.h. The array-like corpus program's logging proxy answers its has trap with `in` instead of Reflect.has, which has no static lowering, so the program stays fully static.